Skip to content

Commit

Permalink
Input: wacom - return proper error if usb_get_extra_descriptor() fails
Browse files Browse the repository at this point in the history
Instead of returning 1 (which is not even negative) let's capture and return
error codde returned by usb_get_extra_descriptor().

Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed May 2, 2012
1 parent 0c9e300 commit a882c93
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a882c93

Please sign in to comment.