tty: Drop the lock_kernel in the private ioctl hook
We don't need the BKL here any more so it can go. In a couple of spots the driver requirements are not clear so push the lock down into the driver. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -1054,6 +1054,8 @@ static int set_serial_info(struct tty_struct *tty,
|
||||
|
||||
if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
|
||||
return -EFAULT;
|
||||
|
||||
lock_kernel();
|
||||
old_priv = *priv;
|
||||
|
||||
/* Do error checking and permission checking */
|
||||
@@ -1069,8 +1071,10 @@ static int set_serial_info(struct tty_struct *tty,
|
||||
}
|
||||
|
||||
if ((new_serial.baud_base != priv->baud_base) &&
|
||||
(new_serial.baud_base < 9600))
|
||||
(new_serial.baud_base < 9600)) {
|
||||
unlock_kernel();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Make the changes - these are privileged changes! */
|
||||
|
||||
@@ -1098,8 +1102,11 @@ check_and_exit:
|
||||
(priv->flags & ASYNC_SPD_MASK)) ||
|
||||
(((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) &&
|
||||
(old_priv.custom_divisor != priv->custom_divisor))) {
|
||||
unlock_kernel();
|
||||
change_speed(tty, port);
|
||||
}
|
||||
else
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
|
||||
} /* set_serial_info */
|
||||
|
Reference in New Issue
Block a user