diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-09-21 10:47:40 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-09-21 10:47:40 -0700 |
commit | 7cb8e392ddce3e2f2358e36c59490dab50c9534f (patch) | |
tree | c74299aa0322e51ae350ec9c81804c9bff689e37 /crypto | |
parent | 587ac5806497d8c9bdb526489f060f9e4b512c16 (diff) | |
download | linux-crypto-7cb8e392ddce3e2f2358e36c59490dab50c9534f.tar.gz linux-crypto-7cb8e392ddce3e2f2358e36c59490dab50c9534f.zip |
async_tx/raid6: add missing dma_unmap calls to the async fail case
If we are unable to offload async_mult() or async_sum_product(), then
unmap the buffers before falling through to the synchronous path.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to '')
-rw-r--r-- | crypto/async_tx/async_raid6_recov.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/async_tx/async_raid6_recov.c b/crypto/async_tx/async_raid6_recov.c index 822a42d1..6d73dde4 100644 --- a/crypto/async_tx/async_raid6_recov.c +++ b/crypto/async_tx/async_raid6_recov.c @@ -55,6 +55,13 @@ async_sum_product(struct page *dest, struct page **srcs, unsigned char *coef, async_tx_submit(chan, tx, submit); return tx; } + + /* could not get a descriptor, unmap and fall through to + * the synchronous path + */ + dma_unmap_page(dev, dma_dest[1], len, DMA_BIDIRECTIONAL); + dma_unmap_page(dev, dma_src[0], len, DMA_TO_DEVICE); + dma_unmap_page(dev, dma_src[1], len, DMA_TO_DEVICE); } /* run the operation synchronously */ @@ -101,6 +108,12 @@ async_mult(struct page *dest, struct page *src, u8 coef, size_t len, async_tx_submit(chan, tx, submit); return tx; } + + /* could not get a descriptor, unmap and fall through to + * the synchronous path + */ + dma_unmap_page(dev, dma_dest[1], len, DMA_BIDIRECTIONAL); + dma_unmap_page(dev, dma_src[0], len, DMA_TO_DEVICE); } /* no channel available, or failed to allocate a descriptor, so |