summaryrefslogtreecommitdiff
path: root/drivers/crypto/allwinner
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-05-18 20:33:54 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2022-06-10 11:40:16 +0300
commit6cb3f9b25c55928b95a02b9ed8e87ed653b3cce8 (patch)
tree16225d9028e5277baeb7d92fcee173c52043be31 /drivers/crypto/allwinner
parentd2765e1b9ac4b2d5a5d5bf17f468c9b3566c3770 (diff)
downloadlinux-6cb3f9b25c55928b95a02b9ed8e87ed653b3cce8.tar.xz
crypto: sun8i-ss - Fix error codes for dma_mapping_error()
If there is a dma_mapping_error() then return negative error codes. Currently this code returns success. Fixes: 801b7d572c0a ("crypto: sun8i-ss - add hmac(sha1)") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/allwinner')
-rw-r--r--drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
index ac417a6b39e5..845019bd9591 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
@@ -586,7 +586,8 @@ retry:
rctx->t_dst[k + 1].len = rctx->t_dst[k].len;
}
addr_xpad = dma_map_single(ss->dev, tfmctx->ipad, bs, DMA_TO_DEVICE);
- if (dma_mapping_error(ss->dev, addr_xpad)) {
+ err = dma_mapping_error(ss->dev, addr_xpad);
+ if (err) {
dev_err(ss->dev, "Fail to create DMA mapping of ipad\n");
goto err_dma_xpad;
}
@@ -612,7 +613,8 @@ retry:
goto err_dma_result;
}
addr_xpad = dma_map_single(ss->dev, tfmctx->opad, bs, DMA_TO_DEVICE);
- if (dma_mapping_error(ss->dev, addr_xpad)) {
+ err = dma_mapping_error(ss->dev, addr_xpad);
+ if (err) {
dev_err(ss->dev, "Fail to create DMA mapping of opad\n");
goto err_dma_xpad;
}