aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/isicom.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:53:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:39 -0400
commit1eac494738a0447ef0c423ee2066f85a44ab59f5 (patch)
tree40be63404867ce11077f52101c31d9e39a6b23fe /drivers/char/isicom.c
parent5a4bc8c1bde7bcb7f02950764e37e9d6bbdb3e32 (diff)
isicom: prepare for lock_kernel push down
Again lock the bits we can't trivially prove are safe without the BKL and remove the broken TIOCS/GSOFTCAR handler. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/isicom.c')
-rw-r--r--drivers/char/isicom.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index eba2883b630e..a69e4bb91ad4 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -1258,6 +1258,8 @@ static int isicom_set_serial_info(struct isi_port *port,
1258 if (copy_from_user(&newinfo, info, sizeof(newinfo))) 1258 if (copy_from_user(&newinfo, info, sizeof(newinfo)))
1259 return -EFAULT; 1259 return -EFAULT;
1260 1260
1261 lock_kernel();
1262
1261 reconfig_port = ((port->flags & ASYNC_SPD_MASK) != 1263 reconfig_port = ((port->flags & ASYNC_SPD_MASK) !=
1262 (newinfo.flags & ASYNC_SPD_MASK)); 1264 (newinfo.flags & ASYNC_SPD_MASK));
1263 1265
@@ -1265,8 +1267,10 @@ static int isicom_set_serial_info(struct isi_port *port,
1265 if ((newinfo.close_delay != port->close_delay) || 1267 if ((newinfo.close_delay != port->close_delay) ||
1266 (newinfo.closing_wait != port->closing_wait) || 1268 (newinfo.closing_wait != port->closing_wait) ||
1267 ((newinfo.flags & ~ASYNC_USR_MASK) != 1269 ((newinfo.flags & ~ASYNC_USR_MASK) !=
1268 (port->flags & ~ASYNC_USR_MASK))) 1270 (port->flags & ~ASYNC_USR_MASK))) {
1271 unlock_kernel();
1269 return -EPERM; 1272 return -EPERM;
1273 }
1270 port->flags = ((port->flags & ~ ASYNC_USR_MASK) | 1274 port->flags = ((port->flags & ~ ASYNC_USR_MASK) |
1271 (newinfo.flags & ASYNC_USR_MASK)); 1275 (newinfo.flags & ASYNC_USR_MASK));
1272 } 1276 }
@@ -1282,6 +1286,7 @@ static int isicom_set_serial_info(struct isi_port *port,
1282 isicom_config_port(port); 1286 isicom_config_port(port);
1283 spin_unlock_irqrestore(&port->card->card_lock, flags); 1287 spin_unlock_irqrestore(&port->card->card_lock, flags);
1284 } 1288 }
1289 unlock_kernel();
1285 return 0; 1290 return 0;
1286} 1291}
1287 1292
@@ -1290,6 +1295,7 @@ static int isicom_get_serial_info(struct isi_port *port,
1290{ 1295{
1291 struct serial_struct out_info; 1296 struct serial_struct out_info;
1292 1297
1298 lock_kernel();
1293 memset(&out_info, 0, sizeof(out_info)); 1299 memset(&out_info, 0, sizeof(out_info));
1294/* out_info.type = ? */ 1300/* out_info.type = ? */
1295 out_info.line = port - isi_ports; 1301 out_info.line = port - isi_ports;
@@ -1299,6 +1305,7 @@ static int isicom_get_serial_info(struct isi_port *port,
1299/* out_info.baud_base = ? */ 1305/* out_info.baud_base = ? */
1300 out_info.close_delay = port->close_delay; 1306 out_info.close_delay = port->close_delay;
1301 out_info.closing_wait = port->closing_wait; 1307 out_info.closing_wait = port->closing_wait;
1308 unlock_kernel();
1302 if (copy_to_user(info, &out_info, sizeof(out_info))) 1309 if (copy_to_user(info, &out_info, sizeof(out_info)))
1303 return -EFAULT; 1310 return -EFAULT;
1304 return 0; 1311 return 0;
@@ -1331,19 +1338,6 @@ static int isicom_ioctl(struct tty_struct *tty, struct file *filp,
1331 tty_wait_until_sent(tty, 0); 1338 tty_wait_until_sent(tty, 0);
1332 isicom_send_break(port, arg ? arg * (HZ/10) : HZ/4); 1339 isicom_send_break(port, arg ? arg * (HZ/10) : HZ/4);
1333 return 0; 1340 return 0;
1334
1335 case TIOCGSOFTCAR:
1336 return put_user(C_CLOCAL(tty) ? 1 : 0,
1337 (unsigned long __user *)argp);
1338
1339 case TIOCSSOFTCAR:
1340 if (get_user(arg, (unsigned long __user *) argp))
1341 return -EFAULT;
1342 tty->termios->c_cflag =
1343 ((tty->termios->c_cflag & ~CLOCAL) |
1344 (arg ? CLOCAL : 0));
1345 return 0;
1346
1347 case TIOCGSERIAL: 1341 case TIOCGSERIAL:
1348 return isicom_get_serial_info(port, argp); 1342 return isicom_get_serial_info(port, argp);
1349 1343