Skip to content

Commit 9c5c6ed

Browse files
bentissJiri Kosina
authored andcommitted
HID: core: cleanup .claimed field on disconnect
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent fa51ee1 commit 9c5c6ed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/hid/hid-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ void hid_disconnect(struct hid_device *hdev)
16591659
hdev->hiddev_disconnect(hdev);
16601660
if (hdev->claimed & HID_CLAIMED_HIDRAW)
16611661
hidraw_disconnect(hdev);
1662+
hdev->claimed = 0;
16621663
}
16631664
EXPORT_SYMBOL_GPL(hid_disconnect);
16641665

0 commit comments

Comments
 (0)