diff options
author | Horia Geanta <horia.geanta@freescale.com> | 2013-05-10 08:08:39 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-05-13 22:37:57 -0400 |
commit | 286233e604d79f0c7fa04abec2180d5d89a74749 (patch) | |
tree | 2ec0ec723c9200a0cc26902ca6fb967b78f17e6f /drivers/crypto/caam | |
parent | f722406faae2d073cc1d01063d1123c35425939e (diff) |
crypto: caam - fix inconsistent assoc dma mapping direction
req->assoc is dma mapped BIDIRECTIONAL and unmapped TO_DEVICE.
Since it is read-only for the device, use TO_DEVICE both for mapping
and unmapping.
Cc: <stable@vger.kernel.org> # 3.9, 3.8
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam')
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 765fdf5ce579..bf416a8391a7 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -1154,7 +1154,7 @@ static struct aead_edesc *aead_edesc_alloc(struct aead_request *req, | |||
1154 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); | 1154 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); |
1155 | 1155 | ||
1156 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, | 1156 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, |
1157 | DMA_BIDIRECTIONAL, assoc_chained); | 1157 | DMA_TO_DEVICE, assoc_chained); |
1158 | if (likely(req->src == req->dst)) { | 1158 | if (likely(req->src == req->dst)) { |
1159 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, | 1159 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, |
1160 | DMA_BIDIRECTIONAL, src_chained); | 1160 | DMA_BIDIRECTIONAL, src_chained); |
@@ -1336,7 +1336,7 @@ static struct aead_edesc *aead_giv_edesc_alloc(struct aead_givcrypt_request | |||
1336 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); | 1336 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); |
1337 | 1337 | ||
1338 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, | 1338 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, |
1339 | DMA_BIDIRECTIONAL, assoc_chained); | 1339 | DMA_TO_DEVICE, assoc_chained); |
1340 | if (likely(req->src == req->dst)) { | 1340 | if (likely(req->src == req->dst)) { |
1341 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, | 1341 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, |
1342 | DMA_BIDIRECTIONAL, src_chained); | 1342 | DMA_BIDIRECTIONAL, src_chained); |