Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99de9a18 authored by Denis Arefev's avatar Denis Arefev Committed by Greg Kroah-Hartman
Browse files

HID: wacom: Add error check to wacom_parse_and_register()



[ Upstream commit 16a9c24f24fbe4564284eb575b18cc20586b9270 ]

   Added a variable check and
   transition in case of an error

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

Signed-off-by: default avatarDenis Arefev <arefev@swemel.ru>
Reviewed-by: default avatarPing Cheng <ping.cheng@wacom.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2af8d963
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -2419,8 +2419,13 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
		goto fail_quirks;
		goto fail_quirks;
	}
	}


	if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR)
	if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) {
		error = hid_hw_open(hdev);
		error = hid_hw_open(hdev);
		if (error) {
			hid_err(hdev, "hw open failed\n");
			goto fail_quirks;
		}
	}


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