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

tty: drop the BKL for driver/ldisc ioctl methods

Now we have pushed the lock down we can stop wrapping the call with a lock in
the tty layer.
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 1c2630cc
...@@ -3459,11 +3459,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -3459,11 +3459,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
switch (cmd) { switch (cmd) {
case TIOCSBRK: case TIOCSBRK:
case TIOCCBRK: case TIOCCBRK:
if (tty->driver->ioctl) { if (tty->driver->ioctl)
lock_kernel();
retval = tty->driver->ioctl(tty, file, cmd, arg); retval = tty->driver->ioctl(tty, file, cmd, arg);
unlock_kernel();
}
return retval; return retval;
/* These two ioctl's always return success; even if */ /* These two ioctl's always return success; even if */
...@@ -3584,18 +3581,14 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -3584,18 +3581,14 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break; break;
} }
if (tty->driver->ioctl) { if (tty->driver->ioctl) {
lock_kernel();
retval = (tty->driver->ioctl)(tty, file, cmd, arg); retval = (tty->driver->ioctl)(tty, file, cmd, arg);
unlock_kernel();
if (retval != -ENOIOCTLCMD) if (retval != -ENOIOCTLCMD)
return retval; return retval;
} }
ld = tty_ldisc_ref_wait(tty); ld = tty_ldisc_ref_wait(tty);
retval = -EINVAL; retval = -EINVAL;
if (ld->ioctl) { if (ld->ioctl) {
lock_kernel();
retval = ld->ioctl(tty, file, cmd, arg); retval = ld->ioctl(tty, file, cmd, arg);
unlock_kernel();
if (retval == -ENOIOCTLCMD) if (retval == -ENOIOCTLCMD)
retval = -EINVAL; retval = -EINVAL;
} }
......
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