Skip to contentSkip to conversation

HID: hiddev, fix lock imbalance

PATCH Applied Jiri Slaby 2 participants 2 messages Jun 19, 2009 – Jun 22, 2009

Subsystems (2)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 HID: hiddev, fix lock imbalance

Add omitted BKL to one switch/case.

---
 drivers/hid/usbhid/hiddev.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/hid/usbhid/hiddev.c +3 -1
index 9e94215..215b2ad 100644
@@ -527,8 +527,10 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
 			goto goodreturn;
 
 		case HIDIOCGCOLLECTIONINDEX:
+			i = field->usage[uref->usage_index].collection_index;
+			unlock_kernel();
 			kfree(uref_multi);
-			return field->usage[uref->usage_index].collection_index;
+			return i;
 		case HIDIOCGUSAGES:
 			for (i = 0; i < uref_multi->num_values; i++)
 				uref_multi->values[i] =
Signature · 1 line
1.6.3.2
Applied
#1 lore raw
Quoted 4 lines · Jiri Slaby
---
 drivers/hid/usbhid/hiddev.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Applied, thanks a lot for spotting that.

Signature · 2 lines
Jiri Kosina
SUSE Labs