All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Access shared touch input by rcu_dereference()
@ 2026-11-04  1:01 Ping Cheng
  2026-11-04  2:26 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Ping Cheng @ 2026-11-04  1:01 UTC (permalink / raw)
  To: jikos, bentiss, linux-input, dmitry.torokhov
  Cc: stable, Ping Cheng, kernel test robot

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: Access shared touch input by rcu_dereference()
  2026-11-04  1:01 [PATCH] HID: wacom: Access shared touch input by rcu_dereference() Ping Cheng
@ 2026-11-04  2:26 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2026-11-04  2:26 UTC (permalink / raw)
  To: Ping Cheng
  Cc: jikos, bentiss, linux-input, stable, Ping Cheng,
	kernel test robot

On Tue, Nov 03, 2026 at 06:01:08PM -0700, Ping Cheng wrote:
> 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>

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-04  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  1:01 [PATCH] HID: wacom: Access shared touch input by rcu_dereference() Ping Cheng
2026-11-04  2:26 ` Dmitry Torokhov

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.