aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-q.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-q.c')
-rw-r--r--drivers/usb/host/ehci-q.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 140bfa423e07..1da2de4d34ed 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -262,6 +262,7 @@ __acquires(ehci->lock)
262#endif 262#endif
263 263
264 /* complete() can reenter this HCD */ 264 /* complete() can reenter this HCD */
265 usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
265 spin_unlock (&ehci->lock); 266 spin_unlock (&ehci->lock);
266 usb_hcd_giveback_urb (ehci_to_hcd(ehci), urb); 267 usb_hcd_giveback_urb (ehci_to_hcd(ehci), urb);
267 spin_lock (&ehci->lock); 268 spin_lock (&ehci->lock);
@@ -913,7 +914,6 @@ static struct ehci_qh *qh_append_tds (
913static int 914static int
914submit_async ( 915submit_async (
915 struct ehci_hcd *ehci, 916 struct ehci_hcd *ehci,
916 struct usb_host_endpoint *ep,
917 struct urb *urb, 917 struct urb *urb,
918 struct list_head *qtd_list, 918 struct list_head *qtd_list,
919 gfp_t mem_flags 919 gfp_t mem_flags
@@ -922,10 +922,10 @@ submit_async (
922 int epnum; 922 int epnum;
923 unsigned long flags; 923 unsigned long flags;
924 struct ehci_qh *qh = NULL; 924 struct ehci_qh *qh = NULL;
925 int rc = 0; 925 int rc;
926 926
927 qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list); 927 qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list);
928 epnum = ep->desc.bEndpointAddress; 928 epnum = urb->ep->desc.bEndpointAddress;
929 929
930#ifdef EHCI_URB_TRACE 930#ifdef EHCI_URB_TRACE
931 ehci_dbg (ehci, 931 ehci_dbg (ehci,
@@ -933,7 +933,7 @@ submit_async (
933 __FUNCTION__, urb->dev->devpath, urb, 933 __FUNCTION__, urb->dev->devpath, urb,
934 epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out", 934 epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out",
935 urb->transfer_buffer_length, 935 urb->transfer_buffer_length,
936 qtd, ep->hcpriv); 936 qtd, urb->ep->hcpriv);
937#endif 937#endif
938 938
939 spin_lock_irqsave (&ehci->lock, flags); 939 spin_lock_irqsave (&ehci->lock, flags);
@@ -942,9 +942,13 @@ submit_async (
942 rc = -ESHUTDOWN; 942 rc = -ESHUTDOWN;
943 goto done; 943 goto done;
944 } 944 }
945 rc = usb_hcd_link_urb_to_ep(ehci_to_hcd(ehci), urb);
946 if (unlikely(rc))
947 goto done;
945 948
946 qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv); 949 qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
947 if (unlikely(qh == NULL)) { 950 if (unlikely(qh == NULL)) {
951 usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
948 rc = -ENOMEM; 952 rc = -ENOMEM;
949 goto done; 953 goto done;
950 } 954 }