Commit 7814f552 authored by Dan Carpenter's avatar Dan Carpenter Committed by Herbert Xu

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: 2f47d580 ("crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d7fc6cfd
...@@ -2410,7 +2410,7 @@ static inline int chcr_hash_dma_map(struct device *dev, ...@@ -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), error = dma_map_sg(dev, req->src, sg_nents(req->src),
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (!error) if (!error)
return error; return -ENOMEM;
req_ctx->is_sg_map = 1; req_ctx->is_sg_map = 1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment