Skip to content

Commit

Permalink
HID: fix lock imbalance in hiddev
Browse files Browse the repository at this point in the history
Don't forget to unlock_kernel() in hiddev_ioctl_usage().
Added in 7961df1
(HID: Switch hiddev to unlocked_ioctl).

Corresponing sparse warning:
drivers/hid/usbhid/hiddev.c:515:10: warning: context imbalance in 'hiddev_ioctl_usage': wrong count at exit
drivers/hid/usbhid/hiddev.c:515:10:    context 'kernel_lock': wanted 0, got 1

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Slaby authored and Jiri Kosina committed Oct 22, 2008
1 parent 0f2c594 commit eb99108
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/hid/usbhid/hiddev.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
if (copy_to_user(user_arg, uref, sizeof(*uref)))
goto fault;

kfree(uref_multi);
return 0;
goto goodreturn;

default:
if (cmd != HIDIOCGUSAGE &&
Expand Down

0 comments on commit eb99108

Please sign in to comment.