Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1563716

[PATCH 1/4] HID: wacom: release the resources before leaving despite devm

From Benjamin Tissoires <benjamin.tissoires@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 1/4] HID: wacom: release the resources before leaving despite devm
Date 2017-01-20 16:30 +0100
Message-ID <t1Jiy-vy-13@gated-at.bofh.it> (permalink)
References <t1Jiy-vy-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/hid/wacom_sys.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 23b272a..734100a 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2495,6 +2495,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);
 }
 
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] HID: wacom: fixes for next Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-20 16:30 +0100
  [PATCH 3/4] HID: wacom: do not attempt to switch mode while in probe Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-20 16:30 +0100
  [PATCH 4/4] HID: wacom: do not shout an error on LED control Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-20 16:30 +0100
    Re: [PATCH 4/4] HID: wacom: do not shout an error on LED control Jason Gerecke <killertofu@gmail.com> - 2017-01-21 03:40 +0100
  [PATCH 1/4] HID: wacom: release the resources before leaving despite devm Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-20 16:30 +0100
  Re: [PATCH 0/4] HID: wacom: fixes for next Jason Gerecke <killertofu@gmail.com> - 2017-01-21 03:40 +0100
    Re: [PATCH 0/4] HID: wacom: fixes for next Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-23 09:10 +0100
      Re: [PATCH 0/4] HID: wacom: fixes for next Jiri Kosina <jikos@kernel.org> - 2017-01-23 11:10 +0100

csiph-web