From: Dan Carpenter Date: Tue, 12 May 2020 08:37:23 +0000 Subject: [PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op() Message-Id: <20200512083723.GB251760@mwanda> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Ayush Sawal , Devulapally Shiva Krishna Cc: Vinay Kumar Yadav , Rohit Maheshwari , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org 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 --- 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