aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-11-05 10:01:13 -0500
committerJiri Kosina <jkosina@suse.cz>2009-11-05 12:59:03 -0500
commit6c857730438cceb56a94ade3029899f52adf3b90 (patch)
tree20b0bf5803f025a6f6fa826cc14560b174c0ed84
parent80f506918fdaaca6b574ba931536a58ce015c7be (diff)
HID: remove BKL from hiddev_ioctl_usage()
The race between ioctl and disconnect is guarded by low level hiddev device mutex (existancelock) since the commit 07903407 ("HID: hiddev cleanup -- handle all error conditions properly"), therefore we can remove the lock_kernel() from hiddev_ioctl_usage(). Acked-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/usbhid/hiddev.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 8b6ee247bfe4..867e08433e4b 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -450,7 +450,6 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
450 uref_multi = kmalloc(sizeof(struct hiddev_usage_ref_multi), GFP_KERNEL); 450 uref_multi = kmalloc(sizeof(struct hiddev_usage_ref_multi), GFP_KERNEL);
451 if (!uref_multi) 451 if (!uref_multi)
452 return -ENOMEM; 452 return -ENOMEM;
453 lock_kernel();
454 uref = &uref_multi->uref; 453 uref = &uref_multi->uref;
455 if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) { 454 if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
456 if (copy_from_user(uref_multi, user_arg, 455 if (copy_from_user(uref_multi, user_arg,
@@ -528,7 +527,6 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
528 527
529 case HIDIOCGCOLLECTIONINDEX: 528 case HIDIOCGCOLLECTIONINDEX:
530 i = field->usage[uref->usage_index].collection_index; 529 i = field->usage[uref->usage_index].collection_index;
531 unlock_kernel();
532 kfree(uref_multi); 530 kfree(uref_multi);
533 return i; 531 return i;
534 case HIDIOCGUSAGES: 532 case HIDIOCGUSAGES:
@@ -547,15 +545,12 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
547 } 545 }
548 546
549goodreturn: 547goodreturn:
550 unlock_kernel();
551 kfree(uref_multi); 548 kfree(uref_multi);
552 return 0; 549 return 0;
553fault: 550fault:
554 unlock_kernel();
555 kfree(uref_multi); 551 kfree(uref_multi);
556 return -EFAULT; 552 return -EFAULT;
557inval: 553inval:
558 unlock_kernel();
559 kfree(uref_multi); 554 kfree(uref_multi);
560 return -EINVAL; 555 return -EINVAL;
561 } 556 }