Skip to content

Commit

Permalink
HID: wacom: Add error check to wacom_parse_and_register()
Browse files Browse the repository at this point in the history
   Added a variable check and
   transition in case of an error

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Denis Arefev <arefev@swemel.ru>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Denis Arefev authored and Jiri Kosina committed May 23, 2023
1 parent ed84c45 commit 16a9c24
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2414,8 +2414,13 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
goto fail_quirks;
}

if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR)
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;
}
}

wacom_set_shared_values(wacom_wac);
devres_close_group(&hdev->dev, wacom);
Expand Down

0 comments on commit 16a9c24

Please sign in to comment.