Skip to content

Commit

Permalink
HID: core: cleanup .claimed field on disconnect
Browse files Browse the repository at this point in the history
When a subdriver is rmmod-ed then re-insmod-ed, the hid device is not
destroyed as it is owned by the transport layer.
So when we re-probed the device, the hid device is assumed to be already
claimed, and can lead to page faults if hid-core tries to forward the
emitted data to the to-be-created claimed node.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Nov 3, 2014
1 parent fa51ee1 commit 9c5c6ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,7 @@ void hid_disconnect(struct hid_device *hdev)
hdev->hiddev_disconnect(hdev);
if (hdev->claimed & HID_CLAIMED_HIDRAW)
hidraw_disconnect(hdev);
hdev->claimed = 0;
}
EXPORT_SYMBOL_GPL(hid_disconnect);

Expand Down

0 comments on commit 9c5c6ed

Please sign in to comment.