]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/serial/ftdi_sio.c
tty: Drop the lock_kernel in the private ioctl hook
[linux-2.6-omap-h63xx.git] / drivers / usb / serial / ftdi_sio.c
index fb6f2933b01badb0075c285078fb6067fc7b6827..ef6cfa5a447feba817ffd8a8a819a8451db1918e 100644 (file)
@@ -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 */