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

Commit a882c932 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Input: wacom - return proper error if usb_get_extra_descriptor() fails



Instead of returning 1 (which is not even negative) let's capture and return
error codde returned by usb_get_extra_descriptor().

Reviewed-by: default avatarChris Bagwell <chris@cnpbagwell.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 0c9e300a
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -517,11 +517,12 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
		goto out;
	}

	if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
		if (usb_get_extra_descriptor(&interface->endpoint[0],
				HID_DEVICET_REPORT, &hid_desc)) {
			printk("wacom: can not retrieve extra class descriptor\n");
			error = 1;
	error = usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc);
	if (error) {
		error = usb_get_extra_descriptor(&interface->endpoint[0],
						 HID_DEVICET_REPORT, &hid_desc);
		if (error) {
			printk(KERN_ERR "wacom: can not retrieve extra class descriptor\n");
			goto out;
		}
	}