Input: wacom - fix error return code in wacom_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sat, 24 Aug 2013 23:41:56 +0000 (16:41 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 25 Aug 2013 00:44:29 +0000 (17:44 -0700)
Fix to return a negative error code from the urb submit error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/tablet/wacom_sys.c

index 1ad3e07986b4612d38ebb281eeb4fd5beda4c4e8..79b69ea47f747abd035d2eb44cad9d724699ddd7 100644 (file)
@@ -1361,8 +1361,10 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
        usb_set_intfdata(intf, wacom);
 
        if (features->quirks & WACOM_QUIRK_MONITOR) {
-               if (usb_submit_urb(wacom->irq, GFP_KERNEL))
+               if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
+                       error = -EIO;
                        goto fail5;
+               }
        }
 
        return 0;
@@ -1417,8 +1419,8 @@ static int wacom_resume(struct usb_interface *intf)
        wacom_query_tablet_data(intf, features);
        wacom_led_control(wacom);
 
-       if ((wacom->open || features->quirks & WACOM_QUIRK_MONITOR)
-            && usb_submit_urb(wacom->irq, GFP_NOIO) < 0)
+       if ((wacom->open || (features->quirks & WACOM_QUIRK_MONITOR)) &&
+           usb_submit_urb(wacom->irq, GFP_NOIO) < 0)
                rv = -EIO;
 
        mutex_unlock(&wacom->lock);