]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: EHCI: fix DMA deallocation bug
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 6 Jan 2011 15:17:09 +0000 (10:17 -0500)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 26 Jun 2011 16:46:19 +0000 (12:46 -0400)
commitc68c7efc9374040d1d224eadebe3dc1a075d5eca
tree6a215eec50a2049188086ac0e0c01cf098b755a0
parent689b76fd83f267005fa6db471d9358b0df646bec
USB: EHCI: fix DMA deallocation bug

commit f75593ceaa08e6d27aec1a5de31cded19e850dd1 upstream.

This patch (as1440) fixes a bug in ehci-hcd.  ehci->periodic_size is
used to compute the size in a dma_alloc_coherent() call, but then it
gets changed later on.  As a result, the corresponding call to
dma_free_coherent() passes a different size from the original
allocation.  Fix the problem by adjusting ehci->periodic_size before
carrying out any of the memory allocations.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/usb/host/ehci-hcd.c