]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
async_tx: add missing DMA unmap to async_memcpy()
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Mon, 5 Nov 2012 10:00:12 +0000 (10:00 +0000)
committerDan Williams <djbw@fb.com>
Sat, 17 Nov 2012 02:04:08 +0000 (18:04 -0800)
Do DMA unmap on ->device_prep_dma_memcpy failure.

Cc: Dan Williams <djbw@fb.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dan Williams <djbw@fb.com>
crypto/async_tx/async_memcpy.c

index 361b5e8239bc307d29882907744423e0b846d85d..9e62feffb374536995e08357866df9787635b19e 100644 (file)
@@ -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) {