aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-09-21 13:47:40 -0400
committerDan Williams <dan.j.williams@intel.com>2009-09-21 13:47:40 -0400
commit1f6672d44c1ae7408b43c06170ec34eb0a0e9b9f (patch)
treeb8c2be522cf71512a5f9587448967d78ae31bfbf /crypto
parentcdef57dbb618608bfffda2fc32c8d0a4012a1d3a (diff)
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 'crypto')
-rw-r--r--crypto/async_tx/async_raid6_recov.c13
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 822a42d10061..6d73dde4786d 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,
55 async_tx_submit(chan, tx, submit); 55 async_tx_submit(chan, tx, submit);
56 return tx; 56 return tx;
57 } 57 }
58
59 /* could not get a descriptor, unmap and fall through to
60 * the synchronous path
61 */
62 dma_unmap_page(dev, dma_dest[1], len, DMA_BIDIRECTIONAL);
63 dma_unmap_page(dev, dma_src[0], len, DMA_TO_DEVICE);
64 dma_unmap_page(dev, dma_src[1], len, DMA_TO_DEVICE);
58 } 65 }
59 66
60 /* run the operation synchronously */ 67 /* run the operation synchronously */
@@ -101,6 +108,12 @@ async_mult(struct page *dest, struct page *src, u8 coef, size_t len,
101 async_tx_submit(chan, tx, submit); 108 async_tx_submit(chan, tx, submit);
102 return tx; 109 return tx;
103 } 110 }
111
112 /* could not get a descriptor, unmap and fall through to
113 * the synchronous path
114 */
115 dma_unmap_page(dev, dma_dest[1], len, DMA_BIDIRECTIONAL);
116 dma_unmap_page(dev, dma_src[0], len, DMA_TO_DEVICE);
104 } 117 }
105 118
106 /* no channel available, or failed to allocate a descriptor, so 119 /* no channel available, or failed to allocate a descriptor, so