diff options
author | Jack Wang <jinpu.wang@ionos.com> | 2022-08-19 08:07:54 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-08-26 18:50:40 +0800 |
commit | 9b32fed8d6715207a0a2cd42f48a147d203a7576 (patch) | |
tree | 12aa4564d31bb67feaff663c0060a689103c1084 /drivers/crypto/ccree | |
parent | 2b02187bdb0bb75000850bd0309e70eb8664159e (diff) | |
download | linux-9b32fed8d6715207a0a2cd42f48a147d203a7576.tar.gz linux-9b32fed8d6715207a0a2cd42f48a147d203a7576.tar.bz2 linux-9b32fed8d6715207a0a2cd42f48a147d203a7576.zip |
crypto: ccree - Fix dma_map_sg error check
dma_map_sg return 0 on error, and dma_map_error is not supposed to use
here.
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree')
-rw-r--r-- | drivers/crypto/ccree/cc_buffer_mgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto/ccree/cc_buffer_mgr.c index 6140e4927322..9efd88f871d1 100644 --- a/drivers/crypto/ccree/cc_buffer_mgr.c +++ b/drivers/crypto/ccree/cc_buffer_mgr.c @@ -274,7 +274,7 @@ static int cc_map_sg(struct device *dev, struct scatterlist *sg, } ret = dma_map_sg(dev, sg, *nents, direction); - if (dma_mapping_error(dev, ret)) { + if (!ret) { *nents = 0; dev_err(dev, "dma_map_sg() sg buffer failed %d\n", ret); return -ENOMEM; |