[PATCH] usb: uhci-hcd: fix uhci_alloc_int_td()
Peter Mamonov
pmamonov at gmail.com
Wed Mar 22 14:36:15 PDT 2017
Signed-off-by: Peter Mamonov <pmamonov at gmail.com>
---
drivers/usb/host/uhci-hcd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 9ad4644e8..04d167ee3 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -554,8 +554,12 @@ static int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
*/
static struct uhci_td *uhci_alloc_int_td(struct uhci_priv *uhci)
{
- return &uhci->tmp_int_td[0];
+ int i;
+ for (i = 0; i < USB_MAX_TEMP_INT_TD; i++)
+ if (uhci->tmp_int_td[i].dev_ptr == 0)
+ return &uhci->tmp_int_td[i];
+ return NULL;
}
/*
--
2.11.0
More information about the barebox
mailing list