[patch 24/37] uhci-hcd: fix list access bug

Greg KH
2006-09-06T23:09:41Z

[-- Attachment #1: uhci-hcd-fix-list-access-bug.patch --]
[-- Type: text/plain, Size: 999 bytes --]

-stable review patch. If anyone has any objections, please let us know.

------------------
From: Alan Stern <stern@rowland.harvard.edu>

When skipping to the last TD of an URB, go to the _last_ entry in the
list instead of the _first_ entry (as780). This fixes Bugzilla #6747 and
possibly others.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/usb/host/uhci-q.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.17.11.orig/drivers/usb/host/uhci-q.c
+++ linux-2.6.17.11/drivers/usb/host/uhci-q.c
@@ -264,7 +264,7 @@ static void uhci_fixup_toggles(struct uh
* need to change any toggles in this URB */
td = list_entry(urbp->td_list.next, struct uhci_td, list);
if (toggle > 1 || uhci_toggle(td_token(td)) == toggle) {
- td = list_entry(urbp->td_list.next, struct uhci_td,
+ td = list_entry(urbp->td_list.prev, struct uhci_td,
list);
toggle = uhci_toggle(td_token(td)) ^ 1;

--