Skip to content

Commit

Permalink
HID: hidraw -- fix missing unlocks in unlocked_ioctl
Browse files Browse the repository at this point in the history
There were 2 places that returned directly instead of releasing their
locks.  I sent a fix for this file earlier but ended up missing these
spots.  I think what happened is that I have improved my checker script
since then...  Or maybe I just screwed up.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Dan Carpenter authored and Jiri Kosina committed Apr 7, 2009
1 parent 0221c81 commit 38089c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,

if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWNAME(0))) {
int len;
if (!hid->name)
return 0;
if (!hid->name) {
ret = 0;
break;
}
len = strlen(hid->name) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
Expand All @@ -297,8 +299,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,

if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWPHYS(0))) {
int len;
if (!hid->phys)
return 0;
if (!hid->phys) {
ret = 0;
break;
}
len = strlen(hid->phys) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
Expand Down

0 comments on commit 38089c6

Please sign in to comment.