Commit bdf183aa authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

rocket: Prepare for BKL pushdown

Wrap the ioctl code in lock_kernel calls
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent eb174552
...@@ -1433,29 +1433,38 @@ static int rp_ioctl(struct tty_struct *tty, struct file *file, ...@@ -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; struct r_port *info = (struct r_port *) tty->driver_data;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int ret = 0;
if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl")) if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl"))
return -ENXIO; return -ENXIO;
lock_kernel();
switch (cmd) { switch (cmd) {
case RCKP_GET_STRUCT: case RCKP_GET_STRUCT:
if (copy_to_user(argp, info, sizeof (struct r_port))) if (copy_to_user(argp, info, sizeof (struct r_port)))
return -EFAULT; ret = -EFAULT;
return 0; break;
case RCKP_GET_CONFIG: case RCKP_GET_CONFIG:
return get_config(info, argp); ret = get_config(info, argp);
break;
case RCKP_SET_CONFIG: case RCKP_SET_CONFIG:
return set_config(info, argp); ret = set_config(info, argp);
break;
case RCKP_GET_PORTS: case RCKP_GET_PORTS:
return get_ports(info, argp); ret = get_ports(info, argp);
break;
case RCKP_RESET_RM2: case RCKP_RESET_RM2:
return reset_rm2(info, argp); ret = reset_rm2(info, argp);
break;
case RCKP_GET_VERSION: case RCKP_GET_VERSION:
return get_version(info, argp); ret = get_version(info, argp);
break;
default: default:
return -ENOIOCTLCMD; ret = -ENOIOCTLCMD;
} }
return 0; unlock_kernel();
return ret;
} }
static void rp_send_xchar(struct tty_struct *tty, char ch) static void rp_send_xchar(struct tty_struct *tty, char ch)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment