From: Benjamin Tissoires <[email protected]>

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 <[email protected]>
Acked-by: Jason Gerecke <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
[[email protected]: Imported into input-wacom repository (5b779fc)]
Signed-off-by: Jason Gerecke <[email protected]>
[[email protected]: Backported from input-wacom repository (4c399ab)]
Signed-off-by: Aaron Armstrong Skomra <[email protected]>
---
 3.17/wacom_sys.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/3.17/wacom_sys.c b/3.17/wacom_sys.c
index 5c4773a..89cc6a4 100644
--- a/3.17/wacom_sys.c
+++ b/3.17/wacom_sys.c
@@ -2353,6 +2353,8 @@ static void wacom_remove(struct hid_device *hdev)
 #endif
        wacom_remove_shared_data(wacom);
 
+       wacom_release_resources(wacom);
+
        hid_set_drvdata(hdev, NULL);
 }
 
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to