From patchwork Tue May 12 08:37:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 11542305 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8291614B4 for ; Tue, 12 May 2020 08:37:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 689E220674 for ; Tue, 12 May 2020 08:37:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fPrfMPs/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725987AbgELIhn (ORCPT ); Tue, 12 May 2020 04:37:43 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45450 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbgELIhn (ORCPT ); Tue, 12 May 2020 04:37:43 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04C8X2D0177219; Tue, 12 May 2020 08:37:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=GTB4Q2paPqx2Xm+TrvAKydqxyrSyjHliAb7/1eK0uKE=; b=fPrfMPs/EyLR3u5GoePWmIfdYI8gZNwA8PAyAGjbsZ+doAuzBcryOLZQzSAqOw7/ENOg Ewx+aB6QlzH/boQwWVg1ysGMaY0gPUQ4J5DmyrUKD9hD7tk0yUTMMebyFMFtxIBtC0Y5 0obEpDg4HXi1KbJEshkxhoLWXk5mouHkIfStuBBcBr4Oz23TmsMZO3cYGmotFbDSmB+q 8o2OKaF/3KW7t5+pDMPn7kgKCvwPZKzjNsNpqSlAtGsQpAlWy8KVmnRA9fKeQ1IyD2th iKY/s2keadtkLCwxcG63GYpDz38b9PEumR1E01j9RiP0K5BtIWZ/CG81hzKFc/nMFz6S kQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 30x3mbsjx5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 May 2020 08:37:32 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04C8Ze5R005527; Tue, 12 May 2020 08:37:32 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 30ydsq06fj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 May 2020 08:37:32 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04C8bUF7011268; Tue, 12 May 2020 08:37:30 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 May 2020 01:37:30 -0700 Date: Tue, 12 May 2020 11:37:23 +0300 From: Dan Carpenter 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 Subject: [PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op() Message-ID: <20200512083723.GB251760@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9618 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005120071 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9618 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 impostorscore=0 mlxscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 adultscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005120071 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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; }