summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorweiyongjun \(A\) <weiyongjun1@huawei.com>2018-03-13 17:54:03 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-03-23 18:39:58 +0300
commitefa94457e57f7b45207554db6e7f1fdaabd0f198 (patch)
tree8955f692225eb7a173c3c86c7255a6ed61100b3e /drivers/crypto
parent0108aab1161532c9b62a0d05b8115f4d0b529831 (diff)
downloadlinux-efa94457e57f7b45207554db6e7f1fdaabd0f198.tar.xz
crypto: inside-secure - fix missing unlock on error in safexcel_ahash_send_req()
Add the missing unlock before return from function safexcel_ahash_send_req() in the error handling case. Fixes: cff9a17545a3 ("crypto: inside-secure - move cache result dma mapping to request") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/inside-secure/safexcel_hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 77268c9f1620..6e9eb9bffec7 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -236,8 +236,10 @@ static int safexcel_ahash_send_req(struct crypto_async_request *async, int ring,
if (cache_len) {
req->cache_dma = dma_map_single(priv->dev, req->cache,
cache_len, DMA_TO_DEVICE);
- if (dma_mapping_error(priv->dev, req->cache_dma))
+ if (dma_mapping_error(priv->dev, req->cache_dma)) {
+ spin_unlock_bh(&priv->ring[ring].egress_lock);
return -EINVAL;
+ }
req->cache_sz = cache_len;
first_cdesc = safexcel_add_cdesc(priv, ring, 1,