diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2017-07-18 21:26:40 +0900 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-07-18 16:19:55 +0300 |
commit | 80584efcc6bc99871433cc5b8f639cc0154962ea (patch) | |
tree | 5a0ca6a704d019507066028f676920981fd33eab | |
parent | 14e1d56cbea6c02d29da945741a35c7e90a86e17 (diff) | |
download | linux-80584efcc6bc99871433cc5b8f639cc0154962ea.tar.gz linux-80584efcc6bc99871433cc5b8f639cc0154962ea.tar.bz2 linux-80584efcc6bc99871433cc5b8f639cc0154962ea.zip |
usb: gadget: udc: renesas_usb3: fix free size in renesas_usb3_dma_free_prd()
The commit 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support
for dedicated DMAC") has a bug in the renesas_usb3_dma_free_prd().
The size of dma_free_coherent() should be the same with dma_alloc_coherent()
Otherwise, this code causes a WARNING by mm/page_alloc.c when
renesas_usb3_dma_free_prd() is called. So, this patch fixes it.
Fixes: 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support for dedicated DMAC")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r-- | drivers/usb/gadget/udc/renesas_usb3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index d8278322d5ac..923ad5acc482 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -1369,7 +1369,7 @@ static int renesas_usb3_dma_free_prd(struct renesas_usb3 *usb3, usb3_for_each_dma(usb3, dma, i) { if (dma->prd) { - dma_free_coherent(dev, USB3_DMA_MAX_XFER_SIZE, + dma_free_coherent(dev, USB3_DMA_PRD_SIZE, dma->prd, dma->prd_dma); dma->prd = NULL; } |