summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-02-03 09:11:38 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-02-09 20:19:48 +0100
commit64905b48098761e779bb848e69365c018894ea81 (patch)
tree3bb7bde4822ada0562cf84574022dd5d0cbeec59 /drivers/usb
parentUSB: usb-storage: add Pentax to the bad-vendor list (diff)
downloadlinux-64905b48098761e779bb848e69365c018894ea81.tar.xz
linux-64905b48098761e779bb848e69365c018894ea81.zip
USB: ftdi_sio: unlock_kernel() on error in set_serial_info()
There was one error path where unlock_kernel() wasn't called. This was found with a code checker (http://repo.or.cz/w/smatch.git/) Compile tested only, sorry. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ftdi_sio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 64b84291c07e..f92f4d773374 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1065,8 +1065,10 @@ static int set_serial_info(struct tty_struct *tty,
if (!capable(CAP_SYS_ADMIN)) {
if (((new_serial.flags & ~ASYNC_USR_MASK) !=
- (priv->flags & ~ASYNC_USR_MASK)))
+ (priv->flags & ~ASYNC_USR_MASK))) {
+ unlock_kernel();
return -EPERM;
+ }
priv->flags = ((priv->flags & ~ASYNC_USR_MASK) |
(new_serial.flags & ASYNC_USR_MASK));
priv->custom_divisor = new_serial.custom_divisor;