diff options
author | Dave Jones <davej@redhat.com> | 2005-12-06 19:14:09 -0800 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2005-12-06 19:14:09 -0800 |
commit | fc457fa7c0cdbfe96812ba377e508880d600298f (patch) | |
tree | 514049d61cf8b1587141a375ba3ec4f71e09a9db /drivers/usb/host/ehci-q.c | |
parent | cc6e8de8f0fab61760bb7091fb19eef1406e17be (diff) | |
parent | e4f5c82a92c2a546a16af1614114eec19120e40a (diff) | |
download | linux-fc457fa7c0cdbfe96812ba377e508880d600298f.tar.gz linux-fc457fa7c0cdbfe96812ba377e508880d600298f.tar.bz2 linux-fc457fa7c0cdbfe96812ba377e508880d600298f.zip |
Merge ../linus/
Diffstat (limited to 'drivers/usb/host/ehci-q.c')
-rw-r--r-- | drivers/usb/host/ehci-q.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 5bb872c3496d..bf03ec0d8ee2 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c @@ -912,6 +912,7 @@ submit_async ( int epnum; unsigned long flags; struct ehci_qh *qh = NULL; + int rc = 0; qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list); epnum = ep->desc.bEndpointAddress; @@ -926,21 +927,28 @@ submit_async ( #endif spin_lock_irqsave (&ehci->lock, flags); + if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, + &ehci_to_hcd(ehci)->flags))) { + rc = -ESHUTDOWN; + goto done; + } + qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv); + if (unlikely(qh == NULL)) { + rc = -ENOMEM; + goto done; + } /* Control/bulk operations through TTs don't need scheduling, * the HC and TT handle it when the TT has a buffer ready. */ - if (likely (qh != NULL)) { - if (likely (qh->qh_state == QH_STATE_IDLE)) - qh_link_async (ehci, qh_get (qh)); - } + if (likely (qh->qh_state == QH_STATE_IDLE)) + qh_link_async (ehci, qh_get (qh)); + done: spin_unlock_irqrestore (&ehci->lock, flags); - if (unlikely (qh == NULL)) { + if (unlikely (qh == NULL)) qtd_list_free (ehci, urb, qtd_list); - return -ENOMEM; - } - return 0; + return rc; } /*-------------------------------------------------------------------------*/ |