aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/usbhid/hiddev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 6a98f9f572b0..d73eea382ab3 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -874,12 +874,14 @@ int hiddev_connect(struct hid_device *hid, unsigned int force)
874 INIT_LIST_HEAD(&hiddev->list); 874 INIT_LIST_HEAD(&hiddev->list);
875 spin_lock_init(&hiddev->list_lock); 875 spin_lock_init(&hiddev->list_lock);
876 mutex_init(&hiddev->existancelock); 876 mutex_init(&hiddev->existancelock);
877 hid->hiddev = hiddev;
877 hiddev->hid = hid; 878 hiddev->hid = hid;
878 hiddev->exist = 1; 879 hiddev->exist = 1;
879 880
880 retval = usb_register_dev(usbhid->intf, &hiddev_class); 881 retval = usb_register_dev(usbhid->intf, &hiddev_class);
881 if (retval) { 882 if (retval) {
882 err_hid("Not able to get a minor for this device."); 883 err_hid("Not able to get a minor for this device.");
884 hid->hiddev = NULL;
883 kfree(hiddev); 885 kfree(hiddev);
884 return -1; 886 return -1;
885 } else { 887 } else {