summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2017-01-20 18:20:11 +0300
committerJiri Kosina <jkosina@suse.cz>2017-01-23 13:00:13 +0300
commit5b779fc52020ac6f5beea31c5eafc3d25cf70dc1 (patch)
tree9f4d6135d0af6022e0c8b5152bf6d4f4a69cb1f7 /drivers/hid
parent2ed5e5af2f9d5fb583ac1d36ba819f787bafbda6 (diff)
downloadlinux-5b779fc52020ac6f5beea31c5eafc3d25cf70dc1.tar.xz
HID: wacom: release the resources before leaving despite devm
In the general case, the resources are properly released by devm without needing to do anything. However, when unplugging the wireless receiver, the kernel segfaults from time to time while calling devres_release_all(). I think in that case the resources attempt to access hid_get_drvdata(hdev) which has been set to null while leaving wacom_remove(). Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/wacom_sys.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 8aeca038cc73..0a817e69e029 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2497,6 +2497,8 @@ static void wacom_remove(struct hid_device *hdev)
if (hdev->bus == BUS_BLUETOOTH)
device_remove_file(&hdev->dev, &dev_attr_speed);
+ wacom_release_resources(wacom);
+
hid_set_drvdata(hdev, NULL);
}