]> err.no Git - linux-2.6/commit
[PATCH] USB: ehci-hcd - fix page pointer allocation in itd_patch()
authorDavid Brownell <david-b@pacbell.net>
Sat, 28 May 2005 17:46:18 +0000 (10:46 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Jun 2005 21:44:00 +0000 (14:44 -0700)
commit77078570abe0848c3076b4f7d42f79b1407f3e8f
tree47b421662c3c2e18cfe0bdf95c0a1ef42d89abb2
parente07fefa6b212f43c40fdbc1a62de690d91a4b617
[PATCH] USB: ehci-hcd - fix page pointer allocation in itd_patch()

The itd_patch() function is responsible for allocating entries in the
buffer page pointer list of the iTD.  Particularly, a new page pointer
is needed every time when buffer data crosses a page boundary.

However, there is a bug in the allocation logic: the function does not
allocate a new entry when the current transaction is the first
transaction in the iTD (as indicated by first!=0).

The consequence is that, when the data of the first transaction begins
somewhere at the end of a page so that it actually does cross the page
boundary, no new page pointer is allocated.  This means that the data
at the end of the first transaction (beyond the page boundary) will be
accessed by the HC using the second page pointer, which is zero.
Furthermore, the first page pointer will be later overwritten by the
page pointers of the other transactions, which will garble it because
the value is or-ed into the iTD field.

All this particular check (for !first) does is cause incorrect
behaviour, so it should be entirely removed (and with it the variable
first that is not used for anything else).

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-sched.c