* [PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req()
@ 2018-03-13 14:54 Wei Yongjun
2018-03-13 15:07 ` Antoine Tenart
2018-03-23 15:58 ` Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2018-03-13 14:54 UTC (permalink / raw)
To: kernel-janitors
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>
---
drivers/crypto/inside-secure/safexcel_hash.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 77268c9..6e9eb9b 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,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req()
2018-03-13 14:54 [PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req() Wei Yongjun
@ 2018-03-13 15:07 ` Antoine Tenart
2018-03-23 15:58 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Antoine Tenart @ 2018-03-13 15:07 UTC (permalink / raw)
To: kernel-janitors
Hi Wei,
On Tue, Mar 13, 2018 at 02:54:03PM +0000, Wei Yongjun wrote:
> 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>
Thanks!
Antoine
> ---
> drivers/crypto/inside-secure/safexcel_hash.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
> index 77268c9..6e9eb9b 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,
>
--
Antoine Ténart, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req()
2018-03-13 14:54 [PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req() Wei Yongjun
2018-03-13 15:07 ` Antoine Tenart
@ 2018-03-23 15:58 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2018-03-23 15:58 UTC (permalink / raw)
To: kernel-janitors
On Tue, Mar 13, 2018 at 02:54:03PM +0000, Wei Yongjun wrote:
> 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>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-23 15:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 14:54 [PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req() Wei Yongjun
2018-03-13 15:07 ` Antoine Tenart
2018-03-23 15:58 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.