USB: EHCI: fix DMA deallocation bug
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 6 Jan 2011 15:17:09 +0000 (10:17 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:36:47 +0000 (15:36 -0800)
commitbd49d662e09555107eca05d29f849fb40e31c49c
tree7146e5580f6a4ab42dcf046fe9d4127a5f163185
parent4e588965b910e1f364d7fcd8c36281e341e43e2e
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