All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Jiri Kosina <jikos@kernel.org>, Ping Cheng <pinglinux@gmail.com>,
	Jason Gerecke <killertofu@gmail.com>,
	Aaron Skomra <skomra@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: [PATCH 1/4] HID: wacom: release the resources before leaving despite devm
Date: Fri, 20 Jan 2017 16:20:11 +0100	[thread overview]
Message-ID: <20170120152014.19775-2-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <20170120152014.19775-1-benjamin.tissoires@redhat.com>

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

  reply	other threads:[~2017-01-20 15:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 15:20 [PATCH 0/4] HID: wacom: fixes for next Benjamin Tissoires
2017-01-20 15:20 ` Benjamin Tissoires [this message]
2017-01-20 15:20 ` [PATCH 2/4] HID: wacom: remove warning while disconnecting devices Benjamin Tissoires
2017-01-20 15:20 ` [PATCH 3/4] HID: wacom: do not attempt to switch mode while in probe Benjamin Tissoires
2017-01-20 15:20 ` [PATCH 4/4] HID: wacom: do not shout an error on LED control Benjamin Tissoires
2017-01-21  2:31   ` Jason Gerecke
2017-01-21  2:35 ` [PATCH 0/4] HID: wacom: fixes for next Jason Gerecke
2017-01-23  8:02   ` Benjamin Tissoires
2017-01-23 10:01     ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170120152014.19775-2-benjamin.tissoires@redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=killertofu@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pinglinux@gmail.com \
    --cc=skomra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.