From: Benjamin Tissoires Date: Mon, 3 Nov 2014 20:33:32 +0000 (-0500) Subject: HID: core: cleanup .claimed field on disconnect X-Git-Tag: firefly_0821_release~176^2~2876^2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9c5c6ed7b5078ba42b1c769a1c29b3ae4a6bee36;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 73bd9e2e42bc..3402033fa52a 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -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);