summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-11-07 21:35:00 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-12 02:10:46 (GMT)
commit2f02bc8af3abb846823811af65ec6cc46a4d525d (patch)
treed2d5930a67122733e3af7aee09560eebd2a912b3 /drivers
parent2656a9abcf1ec8dd5fee6a75d6997a0f2fa0094e (diff)
downloadlinux-fsl-qoriq-2f02bc8af3abb846823811af65ec6cc46a4d525d.tar.xz
USB: report submission of active URBs
This patch (as1633) changes slightly the way usbcore handled submissions of URBs that are already active. It will now return -EBUSY rather than -EINVAL, and it will call WARN_ONCE to draw people's attention to the bug. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/core/urb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 3662287..e0d9d94 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -321,8 +321,13 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
struct usb_host_endpoint *ep;
int is_out;
- if (!urb || urb->hcpriv || !urb->complete)
+ if (!urb || !urb->complete)
return -EINVAL;
+ if (urb->hcpriv) {
+ WARN_ONCE(1, "URB %p submitted while active\n", urb);
+ return -EBUSY;
+ }
+
dev = urb->dev;
if ((!dev) || (dev->state < USB_STATE_UNAUTHENTICATED))
return -ENODEV;