Skip to contentSkip to conversation

Crypto/chcr: drop refcount on error path in chcr_aead_op()

PATCH In review Dan Carpenter 2 participants 2 messages May 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Crypto/chcr: drop refcount on error path in chcr_aead_op()

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

Fixes d91a3159e8d9 ("Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests")
---
 drivers/crypto/chelsio/chcr_algo.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/chelsio/chcr_algo.c +1 -0
index 83ddc2b39490e..e05998a1c0148 100644
@@ -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;
 	}
 
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 13 lines · Dan Carpenter

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

Fixes d91a3159e8d9 ("Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests")
---
  drivers/crypto/chelsio/chcr_algo.c | 1 +
  1 file changed, 1 insertion(+)
drivers/crypto/chelsio/chcr_algo.c +0 -0
index 83ddc2b39490e..e05998a1c0148 100644

drivers/crypto/chelsio/chcr_algo.c static int chcr_aead_op(struct aead_request *req, · line 3750

Quoted 7 lines
drivers/crypto/chelsio/chcr_algo.c +1 -0
@@ -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.