ChangeSet 1.781.21.3, 2002/10/15 00:11:13-07:00, johannes@erdfelt.com [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. diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c Fri Oct 18 14:43:58 2002 +++ b/drivers/usb/host/uhci-hcd.c Fri Oct 18 14:43:58 2002 @@ -1496,12 +1496,19 @@ break; } - spin_unlock_irqrestore(&uhci->urb_list_lock, flags); - 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); + return ret; } + + spin_unlock_irqrestore(&uhci->urb_list_lock, flags); + return 0; }