summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/amlogic/amlogic-gxl-cipher.c
diff options
context:
space:
mode:
authorXiang Chen <chenxiang66@hisilicon.com>2021-03-16 02:55:23 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-26 10:02:34 +0100
commit5595d0dc1d33b36843166644bb33d94c0e34942e (patch)
treee63065f8423b5c1a036b695ffca29d89290e76ae /drivers/crypto/amlogic/amlogic-gxl-cipher.c
parentcrypto: ccp - fix command queuing to TEE ring buffer (diff)
downloadlinux-5595d0dc1d33b36843166644bb33d94c0e34942e.tar.xz
linux-5595d0dc1d33b36843166644bb33d94c0e34942e.zip
crypto: amlogic - Fix the parameter of dma_unmap_sg()
For function dma_unmap_sg(), the <nents> parameter should be number of elements in the scatterlist prior to the mapping, not after the mapping. So fix this usage. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/amlogic/amlogic-gxl-cipher.c')
-rw-r--r--drivers/crypto/amlogic/amlogic-gxl-cipher.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
index 8b5e07316352..c6865cbd334b 100644
--- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
+++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
@@ -236,10 +236,10 @@ static int meson_cipher(struct skcipher_request *areq)
dma_unmap_single(mc->dev, phykeyiv, keyivlen, DMA_TO_DEVICE);
if (areq->src == areq->dst) {
- dma_unmap_sg(mc->dev, areq->src, nr_sgs, DMA_BIDIRECTIONAL);
+ dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_BIDIRECTIONAL);
} else {
- dma_unmap_sg(mc->dev, areq->src, nr_sgs, DMA_TO_DEVICE);
- dma_unmap_sg(mc->dev, areq->dst, nr_sgd, DMA_FROM_DEVICE);
+ dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE);
+ dma_unmap_sg(mc->dev, areq->dst, sg_nents(areq->dst), DMA_FROM_DEVICE);
}
if (areq->iv && ivsize > 0) {