HID: wacom: Access shared touch input by rcu_dereference()
Subsystems (3)
PATCH 1/1 HID: wacom: Access shared touch input by rcu_dereference()
Allow the __rcu-annotated wacom_wac->shared->touch_input to be accessed inside an RCU read-side critical section by using rcu_dereference().
Reported-by kernel test robot <[email protected]>
Fixes 9183319a5ba4 ("Input: wacom - Setup SW_MUTE_DEVICE according to the order of input registration")
Suggested-by Dmitry Torokhov <[email protected]>
Signed-off-by Ping Cheng <[email protected]>
---
The patch is based on for-7.4/wacom branch
--- drivers/hid/wacom_wac.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/hid/wacom_wac.c +7 -6
@@ -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 ;
Signature · 1 line
2.56.0
Quoted 9 lines · Ping Cheng
Allow the __rcu-annotated
wacom_wac->shared->touch_inputto be accessed inside an RCU read-side critical section by usingrcu_dereference().Reported-by kernel test robot <[email protected]>Fixes 9183319a5ba4 ("Input: wacom - Setup SW_MUTE_DEVICE according to the order of input registration")Suggested-by Dmitry Torokhov <[email protected]>Signed-off-by Ping Cheng <[email protected]>
Reviewed-by Dmitry Torokhov <[email protected]>
Thanks.
Signature · 1 line
Dmitry
Quoted 9 lines · Ping Cheng
Allow the __rcu-annotated
wacom_wac->shared->touch_inputto be accessed inside an RCU read-side critical section by usingrcu_dereference().Reported-by kernel test robot <[email protected]>Fixes 9183319a5ba4 ("Input: wacom - Setup SW_MUTE_DEVICE according to the order of input registration")Suggested-by Dmitry Torokhov <[email protected]>Signed-off-by Ping Cheng <[email protected]>
Applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs