]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: EHCI: fix for leaking isochronous data
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 30 Jan 2013 21:35:02 +0000 (16:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Feb 2013 17:04:46 +0000 (09:04 -0800)
commit b09a61cc0bc2a7151f4ab652489e85253d5d0175 upstream.

This patch (as1653) fixes a bug in ehci-hcd.  Unlike iTD entries, an
siTD entry in the periodic schedule may not complete until the frame
after the one it belongs to.  Consequently, when scanning the periodic
schedule it is necessary to start with the frame _preceding_ the one
where the previous scan ended.

Not doing this properly can result in memory leaks and failures to
complete isochronous URBs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Andy Leiserson <andy@leiserson.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-sched.c

index 838e5716e41ab3727a5071ffa507d6eacf057876..c41063dc6a24fbcc5e619a9582185035cc235e21 100644 (file)
@@ -2336,5 +2336,5 @@ restart:
                        break;
                frame = (frame + 1) & fmask;
        }
-       ehci->next_frame = now_frame;
+       ehci->next_frame = (frame - 1) & fmask;
 }