[PATCH] Input: wacom - fix error return code in wacom_probe()

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE4763d

2 messages, 2 authors, 2013-08-24 · open the first message on its own page

[PATCH] Input: wacom - fix error return code in wacom_probe()

From: Wei Yongjun <hidden>
Date: 2013-08-23 02:53:02

From: Wei Yongjun <redacted>

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 <redacted>
---
 drivers/input/tablet/wacom_sys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index aaf23ae..7eeac61 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1366,7 +1366,8 @@ 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))
+		error = usb_submit_urb(wacom->irq, GFP_KERNEL);
+		if (error)
 			goto fail5;
 	}
 

Re: [PATCH] Input: wacom - fix error return code in wacom_probe()

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-08-24 23:41:47

Hi Wei,

On Fri, Aug 23, 2013 at 10:53:00AM +0800, Wei Yongjun wrote:
quoted hunk
From: Wei Yongjun <redacted>

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 <redacted>
---
 drivers/input/tablet/wacom_sys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index aaf23ae..7eeac61 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1366,7 +1366,8 @@ 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))
+		error = usb_submit_urb(wacom->irq, GFP_KERNEL);
+		if (error)
 			goto fail5;
 	}
If I remember correctly usb_submit_urb() uses errno definitions in a
creative way, so returning them verbatim to the upper layers is not teh
beset solution. I will change this to return -EIO instead.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help