Commit 1f5a3d0f authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman
Browse files

USB: fix mistake in usb_hcd_giveback_urb



This patch (as971) fixes a small mistake: The URB's completion status
needs to be adjusted before the URB is passed to usmon_urb_complete(),
not afterward.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ed6e5282
...@@ -1266,9 +1266,6 @@ int usb_hcd_unlink_urb (struct urb *urb, int status) ...@@ -1266,9 +1266,6 @@ int usb_hcd_unlink_urb (struct urb *urb, int status)
*/ */
void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb) void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb)
{ {
unmap_urb_for_dma(hcd, urb);
usbmon_urb_complete (&hcd->self, urb);
usb_unanchor_urb(urb);
urb->hcpriv = NULL; urb->hcpriv = NULL;
if (unlikely(urb->unlinked)) if (unlikely(urb->unlinked))
urb->status = urb->unlinked; urb->status = urb->unlinked;
...@@ -1277,6 +1274,10 @@ void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb) ...@@ -1277,6 +1274,10 @@ void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb)
!urb->status)) !urb->status))
urb->status = -EREMOTEIO; urb->status = -EREMOTEIO;
unmap_urb_for_dma(hcd, urb);
usbmon_urb_complete(&hcd->self, urb);
usb_unanchor_urb(urb);
/* pass ownership to the completion handler */ /* pass ownership to the completion handler */
urb->complete (urb); urb->complete (urb);
atomic_dec (&urb->use_count); atomic_dec (&urb->use_count);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment