Re: [PATCH] HID: wacom: stop hardware after post-start probe failures
From: Jiri Kosina
Date: Wed Jun 03 2026 - 08:27:15 EST
On Wed, 27 May 2026, Dmitry Torokhov wrote:
> > wacom_parse_and_register() starts HID hardware before registering inputs
> > and initializing pad LEDs/remotes. Those later steps can fail, but their
> > error paths currently release Wacom resources without stopping the HID
> > hardware.
> >
> > Route post-hid_hw_start() failures through hid_hw_stop() before
> > releasing driver resources.
> >
> > This issue was identified during our ongoing static-analysis research while
> > reviewing kernel code.
> >
> > Fixes: c1d6708bf0d3 ("HID: wacom: Do not register input devices until after hid_hw_start")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> > Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> > Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
> > ---
> > drivers/hid/wacom_sys.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> > index 0d1c6d90fe..c824d9c224 100644
> > --- a/drivers/hid/wacom_sys.c
> > +++ b/drivers/hid/wacom_sys.c
> > @@ -2456,16 +2456,16 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
> >
> > error = wacom_register_inputs(wacom);
> > if (error)
> > - goto fail;
> > + goto fail_hw_stop;
> >
> > if (wacom->wacom_wac.features.device_type & WACOM_DEVICETYPE_PAD) {
> > error = wacom_initialize_leds(wacom);
> > if (error)
> > - goto fail;
> > + goto fail_hw_stop;
> >
> > error = wacom_initialize_remotes(wacom);
> > if (error)
> > - goto fail;
> > + goto fail_hw_stop;
> > }
> >
> > if (!wireless) {
> > @@ -2496,6 +2496,7 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
> > return 0;
> >
> > fail_quirks:
> > +fail_hw_stop:
> > hid_hw_stop(hdev);
> > fail:
> > wacom_release_resources(wacom);
>
> I'd get rid of 'fail_quirks' and use 'fail_hw_stop' everywhere,
Agreed. Myeonghun, will you send v2 please?
Thanks,
--
Jiri Kosina
SUSE Labs