diff options
author | Jiri Kosina <jkosina@suse.cz> | 2009-01-07 13:25:36 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 11:30:57 -0800 |
commit | 76052749143d03006271cc0ce8205ad756917062 (patch) | |
tree | 35cc5bdd4588513f4ae1a7fde32ff8b037de883a | |
parent | 940fbf411e5fb42aee8ab7dd814b24080951dbfc (diff) | |
download | linux-76052749143d03006271cc0ce8205ad756917062.tar.bz2 |
HID: fix hid->hiddev initialization in hiddev_connect()
Commit 079034073fa ("HID: hiddev cleanup -- handle all error conditions
properly") by mistake removed proper initialization of hid->hiddev pointer
in hiddev_connect() in case usb_register_dev() succeeds for the hiddev node.
Put it properly back in place.
Reported-and-tested-by: Gabriel C <nix.or.die@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 2 |
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) INIT_LIST_HEAD(&hiddev->list); spin_lock_init(&hiddev->list_lock); mutex_init(&hiddev->existancelock); + hid->hiddev = hiddev; hiddev->hid = hid; hiddev->exist = 1; retval = usb_register_dev(usbhid->intf, &hiddev_class); if (retval) { err_hid("Not able to get a minor for this device."); + hid->hiddev = NULL; kfree(hiddev); return -1; } else { |