USB: EHCI: fix DMA deallocation bug
commit5497c9779cac8a144b770ccbfbfad1296f22aff4
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 6 Jan 2011 15:17:09 +0000 (6 10:17 -0500)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Apr 2011 14:52:55 +0000 (30 16:52 +0200)
tree8e20f01148e8a38aa13dcda0ca61c661651fe89c
parenta49e95d780422401e82b434d3e147ce1459d5ff7
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>
drivers/usb/host/ehci-hcd.c