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-Tag: next-20130218~69^2~13 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ae6058400f895664fc9040159e65287b11775cf2;p=karo-tx-linux.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 361b5e8239bc..9e62feffb374 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) {