aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 }