uhci-hcd: fix list access bug
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 31 Aug 2006 18:18:39 +0000 (14:18 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Sep 2006 01:04:30 +0000 (18:04 -0700)
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

index 026dad06f82be60d541b22f6ea0a7856ef8ad5c5..431e8f31f1a976194bef66888af6b11be1fd62fb 100644 (file)
@@ -372,7 +372,7 @@ static void uhci_fixup_toggles(struct uhci_qh *qh, int skip_first)
                 * 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;