This patch fixes a bug where an interrupt URB is unlinked in the drivers
completion handler and we'll try to resubmit it anyway.

JE

--- linux-2.4.18-pre9.orig/drivers/usb/uhci.c   Tue Feb 19 22:05:50 2002
+++ linux-2.4.18-pre9/drivers/usb/uhci.c        Tue Feb 19 22:07:42 2002
@@ -2255,7 +2255,7 @@
        killed = (urb->status == -ENOENT || urb->status == -ECONNABORTED ||
                        urb->status == -ECONNRESET);
        resubmit_interrupt = (usb_pipetype(urb->pipe) == PIPE_INTERRUPT &&
-                       urb->interval && !killed);
+                       urb->interval);
 
        nurb = urb->next;
        if (nurb && !killed) {
@@ -2281,7 +2281,7 @@
        }
 
        status = urbp->status;
-       if (!resubmit_interrupt)
+       if (!resubmit_interrupt || killed)
                /* We don't need urb_priv anymore */
                uhci_destroy_urb_priv(urb);
 
@@ -2298,10 +2298,17 @@
                        sizeof(devrequest), PCI_DMA_TODEVICE);
 
        urb->dev = NULL;
-       if (urb->complete)
+       if (urb->complete) {
                urb->complete(urb);
 
-       if (resubmit_interrupt) {
+               /* Recheck the status. The completion handler may have */
+               /*  unlinked the resubmitting interrupt URB */
+               killed = (urb->status == -ENOENT ||
+                         urb->status == -ECONNABORTED ||
+                         urb->status == -ECONNRESET);
+       }
+
+       if (resubmit_interrupt && !killed) {
                urb->dev = dev;
                uhci_reset_interrupt(urb);
        } else {

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to