Skip to content

Commit

Permalink
async_tx: add missing DMA unmap to async_memcpy()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bzolnier authored and Vinod Koul committed Jan 8, 2013
1 parent 2c88ae9 commit 35fa4db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/async_tx/async_memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 35fa4db

Please sign in to comment.