From: Bartlomiej Zolnierkiewicz Date: Mon, 5 Nov 2012 10:00:12 +0000 (+0000) Subject: async_tx: add missing DMA unmap to async_memcpy() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35fa4dbc8c877c69144736cfe144a95a1e7ccc1a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git async_tx: add missing DMA unmap to async_memcpy() Do DMA unmap on ->device_prep_dma_memcpy failure. Cc: Dan Williams Cc: Tomasz Figa Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Kyungmin Park Signed-off-by: Dan Williams --- diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c index 361b5e8239b..9e62feffb37 100644 --- a/crypto/async_tx/async_memcpy.c +++ b/crypto/async_tx/async_memcpy.c @@ -67,6 +67,12 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, tx = device->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, dma_prep_flags); + if (!tx) { + dma_unmap_page(device->dev, dma_dest, len, + DMA_FROM_DEVICE); + dma_unmap_page(device->dev, dma_src, len, + DMA_TO_DEVICE); + } } if (tx) {