Commit cc115573 authored by Johannes Erdfelt's avatar Johannes Erdfelt Committed by Greg Kroah-Hartman

[PATCH] uhci.c, interrupt unlink in completion

This patch fixes a bug where an interrupt URB is unlinked in the drivers
completion handler and we'll try to resubmit it anyway.
parent 242f58b9
...@@ -2263,7 +2263,7 @@ static void uhci_call_completion(struct urb *urb) ...@@ -2263,7 +2263,7 @@ static void uhci_call_completion(struct urb *urb)
killed = (urb->status == -ENOENT || urb->status == -ECONNABORTED || killed = (urb->status == -ENOENT || urb->status == -ECONNABORTED ||
urb->status == -ECONNRESET); urb->status == -ECONNRESET);
resubmit_interrupt = (usb_pipetype(urb->pipe) == PIPE_INTERRUPT && resubmit_interrupt = (usb_pipetype(urb->pipe) == PIPE_INTERRUPT &&
urb->interval && !killed); urb->interval);
nurb = urb->next; nurb = urb->next;
if (nurb && !killed) { if (nurb && !killed) {
...@@ -2289,7 +2289,7 @@ static void uhci_call_completion(struct urb *urb) ...@@ -2289,7 +2289,7 @@ static void uhci_call_completion(struct urb *urb)
} }
status = urbp->status; status = urbp->status;
if (!resubmit_interrupt) if (!resubmit_interrupt || killed)
/* We don't need urb_priv anymore */ /* We don't need urb_priv anymore */
uhci_destroy_urb_priv(urb); uhci_destroy_urb_priv(urb);
...@@ -2306,10 +2306,17 @@ static void uhci_call_completion(struct urb *urb) ...@@ -2306,10 +2306,17 @@ static void uhci_call_completion(struct urb *urb)
sizeof(struct usb_ctrlrequest), PCI_DMA_TODEVICE); sizeof(struct usb_ctrlrequest), PCI_DMA_TODEVICE);
urb->dev = NULL; urb->dev = NULL;
if (urb->complete) if (urb->complete) {
urb->complete(urb); 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; urb->dev = dev;
uhci_reset_interrupt(urb); uhci_reset_interrupt(urb);
} else { } else {
......
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