summaryrefslogtreecommitdiff
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-04-07 16:35:56 +0200
committerJiri Kosina <jkosina@suse.cz>2009-04-07 16:35:56 +0200
commit38089c658bf372adc2bd7b3597fceac0c7cecca6 (patch)
tree5405426d82594bc2424d1036996bc1da0d1aade4 /drivers/hid/hidraw.c
parent0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff)
downloadlwn-38089c658bf372adc2bd7b3597fceac0c7cecca6.tar.gz
lwn-38089c658bf372adc2bd7b3597fceac0c7cecca6.zip
HID: hidraw -- fix missing unlocks in unlocked_ioctl
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>
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r--drivers/hid/hidraw.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index e263d4731179..00ccf4b1985d 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -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);
@@ -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);