Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op()
@ 2020-05-12  8:37 Dan Carpenter
  2020-05-12 19:18 ` Ayush Sawal
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-05-12  8:37 UTC (permalink / raw)
  To: Ayush Sawal, Devulapally Shiva Krishna
  Cc: Vinay Kumar Yadav, Rohit Maheshwari, Herbert Xu, David S. Miller,
	linux-crypto, kernel-janitors

We need to drop inflight counter before returning on this error path.

Fixes: d91a3159e8d9 ("Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/crypto/chelsio/chcr_algo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 83ddc2b39490e..e05998a1c0148 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -3744,6 +3744,7 @@ static int chcr_aead_op(struct aead_request *req,
 	    crypto_ipsec_check_assoclen(req->assoclen) != 0) {
 		pr_err("RFC4106: Invalid value of assoclen %d\n",
 		       req->assoclen);
+		chcr_dec_wrcount(cdev);
 		return -EINVAL;
 	}
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op()
  2020-05-12  8:37 [PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op() Dan Carpenter
@ 2020-05-12 19:18 ` Ayush Sawal
  0 siblings, 0 replies; 2+ messages in thread
From: Ayush Sawal @ 2020-05-12 19:18 UTC (permalink / raw)
  To: Dan Carpenter, Devulapally Shiva Krishna
  Cc: ayush.sawal, Vinay Kumar Yadav, Rohit Maheshwari, Herbert Xu,
	David S. Miller, linux-crypto, kernel-janitors


On 5/12/2020 2:07 PM, Dan Carpenter wrote:
> We need to drop inflight counter before returning on this error path.
>
> Fixes: d91a3159e8d9 ("Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/crypto/chelsio/chcr_algo.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
> index 83ddc2b39490e..e05998a1c0148 100644
> --- a/drivers/crypto/chelsio/chcr_algo.c
> +++ b/drivers/crypto/chelsio/chcr_algo.c
> @@ -3744,6 +3744,7 @@ static int chcr_aead_op(struct aead_request *req,
>   	    crypto_ipsec_check_assoclen(req->assoclen) != 0) {
>   		pr_err("RFC4106: Invalid value of assoclen %d\n",
>   		       req->assoclen);
> +		chcr_dec_wrcount(cdev);
>   		return -EINVAL;
>   	}
>   


Looks good. Thanks a lot.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-12 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12  8:37 [PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op() Dan Carpenter
2020-05-12 19:18 ` Ayush Sawal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox