summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-11-09 22:25:43 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2017-11-29 06:43:49 +0100
commit7814f552ff826fefa5e1b24083c7a06a9378e9ef (patch)
tree4aeecba13ef4420b0a5fe7684ea38c6abbce9396
parentcrypto: chelsio - remove redundant assignments to reqctx and dst_size (diff)
downloadlinux-7814f552ff826fefa5e1b24083c7a06a9378e9ef.tar.xz
linux-7814f552ff826fefa5e1b24083c7a06a9378e9ef.zip
crypto: chelsio - Fix an error code in chcr_hash_dma_map()
The dma_map_sg() function returns zero on error and positive values on success. We want to return -ENOMEM on failure here and zero on success. Fixes: 2f47d5804311 ("crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/chelsio/chcr_algo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 300e66fe8a3c..af08dd264ca7 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -2410,7 +2410,7 @@ static inline int chcr_hash_dma_map(struct device *dev,
error = dma_map_sg(dev, req->src, sg_nents(req->src),
DMA_TO_DEVICE);
if (!error)
- return error;
+ return -ENOMEM;
req_ctx->is_sg_map = 1;
return 0;
}