Char: mxser, remove unnecessary tty test
Subsystems (2)
PATCH 1/2 Char: mxser, remove unnecessary tty test
Stanse found unnecessary test in mxser_startup.
tty is dereferenced earlier, the test is superfluous. Remove it.
Signed-off-by Jiri Slaby <[email protected]>
--- drivers/char/mxser.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/char/mxser.c +1 -2
@@ -905,8 +905,7 @@ static int mxser_startup(struct tty_struct *tty)if (inb (info->ioaddr +UART_LSR ) ==0xff ) {spin_unlock_irqrestore (&info->slock, flags);if (capable (CAP_SYS_ADMIN )) { -if (tty) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_IO_ERROR , &tty->flags);return 0 ; }else return -ENODEV ;
Signature · 1 line
1.6.4.2
PATCH 2/2 Char: vt_ioctl, fix BKL imbalance
Stanse found (again) a BKL imbalance in vt_ioctl.
It's easily triggerable by ioctl(dev_tty_fd, VT_SETACTIVATE, NULL);
Introduced by "vt: add an activate and lock".
Signed-off-by Jiri Slaby <[email protected]>
Cc Alan Cox <[email protected]>
--- drivers/char/vt_ioctl.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/char/vt_ioctl.c +4 -2
@@ -981,8 +981,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, goto eperm;if (copy_from_user (&vsa, (struct vt_setactivate __user *)arg, -sizeof (struct vt_setactivate ))) -return -EFAULT ; +sizeof (struct vt_setactivate ))) { + ret = -EFAULT ; + goto out; + }if (vsa.console ==0 || vsa.console >MAX_NR_CONSOLES ) ret = -ENXIO ;else {
Signature · 1 line
1.6.4.2