diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2012-11-05 05:00:12 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-01-08 01:04:57 -0500 |
commit | 35fa4dbc8c877c69144736cfe144a95a1e7ccc1a (patch) | |
tree | 0ba0b3547e67a16486c8ac593a480ac61e6c9330 /crypto | |
parent | 2c88ae90939c2ef8ae80b07713b898c577b81598 (diff) |
async_tx: add missing DMA unmap to async_memcpy()
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>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/async_tx/async_memcpy.c | 6 |
1 files changed, 6 insertions, 0 deletions
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, | |||
67 | 67 | ||
68 | tx = device->device_prep_dma_memcpy(chan, dma_dest, dma_src, | 68 | tx = device->device_prep_dma_memcpy(chan, dma_dest, dma_src, |
69 | len, dma_prep_flags); | 69 | len, dma_prep_flags); |
70 | if (!tx) { | ||
71 | dma_unmap_page(device->dev, dma_dest, len, | ||
72 | DMA_FROM_DEVICE); | ||
73 | dma_unmap_page(device->dev, dma_src, len, | ||
74 | DMA_TO_DEVICE); | ||
75 | } | ||
70 | } | 76 | } |
71 | 77 | ||
72 | if (tx) { | 78 | if (tx) { |