HID: wacom: release the resources before leaving despite devm
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 20 Jan 2017 15:20:11 +0000 (16:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:26:07 +0000 (10:26 +0200)
commitfd9597d6ea2803f1929bc9e91ea159e5a9be8480
tree91aa5343e9bbbdac02eb328c3201a09f440c25a7
parentd621f970fd71d30a84199f1890cddcbd503829bc
HID: wacom: release the resources before leaving despite devm

[ Upstream commit 5b779fc52020ac6f5beea31c5eafc3d25cf70dc1 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_sys.c