summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 00:53:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:39 -0700
commitbdf183aa47dcb46782e22ebd4d1061e47ad74b14 (patch)
tree0da6fb07ad69db2e546f46a4b706d9811a866acb /drivers/char
parenteb1745529622f204733139bde2201eb4ee994c03 (diff)
downloadlinux-bdf183aa47dcb46782e22ebd4d1061e47ad74b14.tar.bz2
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')
-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,
{
struct r_port *info = (struct r_port *) tty->driver_data;
void __user *argp = (void __user *)arg;
+ int ret = 0;
if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl"))
return -ENXIO;
+ lock_kernel();
+
switch (cmd) {
case RCKP_GET_STRUCT:
if (copy_to_user(argp, info, sizeof (struct r_port)))
- return -EFAULT;
- return 0;
+ ret = -EFAULT;
+ break;
case RCKP_GET_CONFIG:
- return get_config(info, argp);
+ ret = get_config(info, argp);
+ break;
case RCKP_SET_CONFIG:
- return set_config(info, argp);
+ ret = set_config(info, argp);
+ break;
case RCKP_GET_PORTS:
- return get_ports(info, argp);
+ ret = get_ports(info, argp);
+ break;
case RCKP_RESET_RM2:
- return reset_rm2(info, argp);
+ ret = reset_rm2(info, argp);
+ break;
case RCKP_GET_VERSION:
- return get_version(info, argp);
+ ret = get_version(info, argp);
+ break;
default:
- return -ENOIOCTLCMD;
+ ret = -ENOIOCTLCMD;
}
- return 0;
+ unlock_kernel();
+ return ret;
}
static void rp_send_xchar(struct tty_struct *tty, char ch)