Skip to content

Commit

Permalink
USB: ftdi_sio: unlock_kernel() on error in set_serial_info()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Feb 9, 2009
1 parent 506e946 commit 64905b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 64905b4

Please sign in to comment.