aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rocket.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:53:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:39 -0400
commitbdf183aa47dcb46782e22ebd4d1061e47ad74b14 (patch)
tree0da6fb07ad69db2e546f46a4b706d9811a866acb /drivers/char/rocket.c
parenteb1745529622f204733139bde2201eb4ee994c03 (diff)
rocket: Prepare for BKL pushdown
Wrap the ioctl code in lock_kernel calls 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/rocket.c')
-rw-r--r--drivers/char/rocket.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index f585bc8579e9..1b3fc6fd358e 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1433,29 +1433,38 @@ static int rp_ioctl(struct tty_struct *tty, struct file *file,
1433{ 1433{
1434 struct r_port *info = (struct r_port *) tty->driver_data; 1434 struct r_port *info = (struct r_port *) tty->driver_data;
1435 void __user *argp = (void __user *)arg; 1435 void __user *argp = (void __user *)arg;
1436 int ret = 0;
1436 1437
1437 if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl")) 1438 if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl"))
1438 return -ENXIO; 1439 return -ENXIO;
1439 1440
1441 lock_kernel();
1442
1440 switch (cmd) { 1443 switch (cmd) {
1441 case RCKP_GET_STRUCT: 1444 case RCKP_GET_STRUCT:
1442 if (copy_to_user(argp, info, sizeof (struct r_port))) 1445 if (copy_to_user(argp, info, sizeof (struct r_port)))
1443 return -EFAULT; 1446 ret = -EFAULT;
1444 return 0; 1447 break;
1445 case RCKP_GET_CONFIG: 1448 case RCKP_GET_CONFIG:
1446 return get_config(info, argp); 1449 ret = get_config(info, argp);
1450 break;
1447 case RCKP_SET_CONFIG: 1451 case RCKP_SET_CONFIG:
1448 return set_config(info, argp); 1452 ret = set_config(info, argp);
1453 break;
1449 case RCKP_GET_PORTS: 1454 case RCKP_GET_PORTS:
1450 return get_ports(info, argp); 1455 ret = get_ports(info, argp);
1456 break;
1451 case RCKP_RESET_RM2: 1457 case RCKP_RESET_RM2:
1452 return reset_rm2(info, argp); 1458 ret = reset_rm2(info, argp);
1459 break;
1453 case RCKP_GET_VERSION: 1460 case RCKP_GET_VERSION:
1454 return get_version(info, argp); 1461 ret = get_version(info, argp);
1462 break;
1455 default: 1463 default:
1456 return -ENOIOCTLCMD; 1464 ret = -ENOIOCTLCMD;
1457 } 1465 }
1458 return 0; 1466 unlock_kernel();
1467 return ret;
1459} 1468}
1460 1469
1461static void rp_send_xchar(struct tty_struct *tty, char ch) 1470static void rp_send_xchar(struct tty_struct *tty, char ch)