提交 5b779fc5 编写于 作者: B Benjamin Tissoires 提交者: Jiri Kosina

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: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: NJason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 2ed5e5af
...@@ -2497,6 +2497,8 @@ static void wacom_remove(struct hid_device *hdev) ...@@ -2497,6 +2497,8 @@ static void wacom_remove(struct hid_device *hdev)
if (hdev->bus == BUS_BLUETOOTH) if (hdev->bus == BUS_BLUETOOTH)
device_remove_file(&hdev->dev, &dev_attr_speed); device_remove_file(&hdev->dev, &dev_attr_speed);
wacom_release_resources(wacom);
hid_set_drvdata(hdev, NULL); hid_set_drvdata(hdev, NULL);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册