usb: dwc3: Fix size used in dma_free_coherent()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 7 Oct 2016 20:12:39 +0000 (22:12 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 17 Oct 2016 09:35:48 +0000 (12:35 +0300)
commit51fbc7c06c8900370c6da5fc4a4685add8fa4fb0
tree37c9adbc931422666a876e9d9d47ddd300eb6359
parenta9e6f83c2df199187a5248f824f31b6787ae23ae
usb: dwc3: Fix size used in dma_free_coherent()

In commit 2abd9d5fa60f9 ("usb: dwc3: ep0: Add chained TRB support"), the
size of the memory allocated with 'dma_alloc_coherent()' has been modified
but the corresponding calls to 'dma_free_coherent()' have not been updated
accordingly.

This has been spotted with coccinelle, using the following script:
////////////////////
@r@
expression x0, x1, y0, y1, z0, z1, t0, t1, ret;
@@

*   ret = dma_alloc_coherent(x0, y0, z0, t0);
    ...
*   dma_free_coherent(x1, y1, ret, t1);

@script:python@
y0 << r.y0;
y1 << r.y1;

@@
if y1.find(y0) == -1:
 print "WARNING: sizes look different:  '%s'   vs   '%s'" % (y0, y1)
////////////////////

Fixes: 2abd9d5fa60f9 ("usb: dwc3: ep0: Add chained TRB support")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c