HID: kernel oops in out_cleanup in function hidinput_connect
authorBenjamin Tissoires <benjamin.tissoires@enac.fr>
Tue, 15 Feb 2011 14:41:10 +0000 (15:41 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 15 Feb 2011 22:47:05 +0000 (23:47 +0100)
Goto out_cleanup infers a kernel oops: hidinput_disconnect calls
input_unregister_driver to all members of hid->inputs.
However, hidinput already has been added to hid->inputs even
though input_register_device was not called.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c

index 7f552bfad32c01a26bb52a239175a801754103bd..f53911dcdc2dd047159f7a4a4d53787e56b60467 100644 (file)
@@ -928,6 +928,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
        return 0;
 
 out_cleanup:
+       list_del(&hidinput->list);
        input_free_device(hidinput->input);
        kfree(hidinput);
 out_unwind: