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

[PATCH] 2.5 uhci remove urb from lists on error

I'm applying Dan's patches by hand to double check everything and I
wanted to get a couple of the trivial ones out of the way first.

This patch fixes a bug where errors on the submit path wouldn't remove
URB's from the HC linked list.

  If we fail adding the URB to the schedule, we need to make
  sure that we remove it from the urb_list. Thanks to
  Dan Streetman for finding and fixing this bug.
parent cd0c2b2a
...@@ -1496,12 +1496,19 @@ static int uhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, int mem_flags) ...@@ -1496,12 +1496,19 @@ static int uhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, int mem_flags)
break; break;
} }
spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
if (ret != -EINPROGRESS) { if (ret != -EINPROGRESS) {
/* Submit failed, so delete it from the urb_list */
struct urb_priv *urbp = urb->hcpriv;
list_del_init(&urbp->urb_list);
spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
uhci_destroy_urb_priv (uhci, urb); uhci_destroy_urb_priv (uhci, urb);
return ret; return ret;
} }
spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
return 0; return 0;
} }
......
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