mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
HID: wacom: stop hardware after post-start probe failures
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: c1d6708bf0 ("HID: wacom: Do not register input devices until after hid_hw_start")
Cc: stable@vger.kernel.org
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
cb605d48da
commit
ec2612b8ad
|
|
@ -2460,16 +2460,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) {
|
||||
|
|
@ -2483,14 +2483,14 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
|||
cancel_delayed_work_sync(&wacom->init_work);
|
||||
_wacom_query_tablet_data(wacom);
|
||||
error = -ENODEV;
|
||||
goto fail_quirks;
|
||||
goto fail_hw_stop;
|
||||
}
|
||||
|
||||
if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) {
|
||||
error = hid_hw_open(hdev);
|
||||
if (error) {
|
||||
hid_err(hdev, "hw open failed\n");
|
||||
goto fail_quirks;
|
||||
goto fail_hw_stop;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2499,7 +2499,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user