From: Benjamin Tissoires Date: Fri, 20 Jan 2017 15:20:11 +0000 (+0100) Subject: HID: wacom: release the resources before leaving despite devm X-Git-Tag: v4.9.54~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd9597d6ea2803f1929bc9e91ea159e5a9be8480;p=profile%2Fwearable%2Fplatform%2Fkernel%2Flinux-4.9-exynos9110.git 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 Acked-by: Jason Gerecke Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 0c535d0..53ac19b 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2433,6 +2433,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); }