diff options
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 5 |
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 | ||
549 | goodreturn: | 547 | goodreturn: |
550 | unlock_kernel(); | ||
551 | kfree(uref_multi); | 548 | kfree(uref_multi); |
552 | return 0; | 549 | return 0; |
553 | fault: | 550 | fault: |
554 | unlock_kernel(); | ||
555 | kfree(uref_multi); | 551 | kfree(uref_multi); |
556 | return -EFAULT; | 552 | return -EFAULT; |
557 | inval: | 553 | inval: |
558 | unlock_kernel(); | ||
559 | kfree(uref_multi); | 554 | kfree(uref_multi); |
560 | return -EINVAL; | 555 | return -EINVAL; |
561 | } | 556 | } |