From: Ping Cheng <pinglinux@gmail.com>
To: jikos@kernel.org, bentiss@kernel.org,
linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Cc: stable@vger.kernel.org, Ping Cheng <ping.cheng@wacom.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH] HID: wacom: Access shared touch input by rcu_dereference()
Date: Tue, 3 Nov 2026 18:01:08 -0700 [thread overview]
Message-ID: <20261104010108.21895-1-ping.cheng@wacom.com> (raw)
Allow the __rcu-annotated wacom_wac->shared->touch_input to be accessed
inside an RCU read-side critical section by using rcu_dereference().
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610180015.KsRqmoTE-lkp@intel.com/
Fixes: 9183319a5ba4 ("Input: wacom - Setup SW_MUTE_DEVICE according to the order of input registration")
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
---
The patch is based on for-7.4/wacom branch
---
drivers/hid/wacom_wac.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index cf459c16b39a..ef6480338b2c 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -4414,7 +4414,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
break;
case HID_GENERIC:
- if (wacom_wac->shared) {
+ if (wacom_wac->shared && wacom_wac->has_mute_touch_switch) {
/*
* The setup of touch switch capability can only be done
* here for those devices, such as Cintiq Pro 13 and 16,
@@ -4425,11 +4425,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
* stylus first or touch first. This path covers the touch
* input first case.
*/
- if (wacom_wac->has_mute_touch_switch &&
- wacom_wac->shared->touch_input) {
- input_set_capability(wacom_wac->shared->touch_input,
- EV_SW, SW_MUTE_DEVICE);
- }
+ struct input_dev *touch_input;
+
+ guard(rcu)();
+ touch_input = rcu_dereference(wacom_wac->shared->touch_input);
+ if (touch_input)
+ input_set_capability(touch_input, EV_SW, SW_MUTE_DEVICE);
}
break;
--
2.56.0
next reply other threads:[~2026-11-04 1:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 1:01 Ping Cheng [this message]
2026-11-04 2:26 ` [PATCH] HID: wacom: Access shared touch input by rcu_dereference() Dmitry Torokhov
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=20261104010108.21895-1-ping.cheng@wacom.com \
--to=pinglinux@gmail.com \
--cc=bentiss@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=lkp@intel.com \
--cc=ping.cheng@wacom.com \
--cc=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox