From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5B84A04DB; Thu, 10 Dec 2020 00:55:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C0D4C9BA; Thu, 10 Dec 2020 00:54:03 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 0AEEEC99E; Thu, 10 Dec 2020 00:54:00 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id s2so1817272plr.9; Wed, 09 Dec 2020 15:53:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AgLJF5O8wOVwEQYh4CO/JDSAHKIbOStTU2/x9/E6qQk=; b=FzLCUiCn7r1EaYdy57jTNBApV0Bzxi9Zdl2Dj25w9VSOH361RLchNOZM6ZGfs8YUho l/Ru25JHMWC7/4ku+r1BRdaFRZtO2H1FgHtQGN3kceKhPl2sp5r/tIgYW6hd7+rQqUVP M2kKddj0xA/P0kOvZC/wfb2UrOVc+AIftX99Dfye34yc3Jqg9p7xaV5VC4u2extY9CpM seqhHSp8sts16oOQ8Z1c+9SvujaEfxxkkVjBrwklGNe0yejVvBJnxxygHhUhq5CeXbKg j11cSJIq91lQ04QYrAJ3OGLcRaW7UXg7X/S5JaeavMdILcmFfbq3OrjKF0ffFrIa/jzu DWjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AgLJF5O8wOVwEQYh4CO/JDSAHKIbOStTU2/x9/E6qQk=; b=AUJ+ABIyUbhyk3FBevIjav9gfxFR02LIvGoYDrnk8Ls1UTSo5DYyxhgtUb1lL0issy 88ReVlXDVIQ2TTeijFLhSDpv539KRm55KO3CBJXDaAh913kDJ8JWllUMC6sxsC2gJU39 FNOuh85/h+UFc9iEAWNNbOG1uQtEsiiY0ln8Cxp6mLxvLed1NOyX8PwCqbD7vG1wZhtH b20qj+OCkGCb1uFI1XLZBx8ExieKsZURcC9ykJqtmTl2B5CSIwyug++elheUEGXt8gxZ qpXmp27BfYZvxmxFiTZMiq4Mgn+vOXcWMzXKC6bRF+zqMUnL/igTbSy0Q1DO6gNCxIjg rQfA== X-Gm-Message-State: AOAM531FiZvJOXPhIPUG+19d95lWfAMBgSRBNX9PiM2TpZsg/ClmnV5w 8J6yeHLqb85t5ZMnQPAi9biZyByqg6fRGa7O X-Google-Smtp-Source: ABdhPJzhxwk4GRDXe/ouYjvHVROKaEf8Etf8XQWcVQD6kduH90SRW0DYktbgITUs0jlvp32QJQBdtQ== X-Received: by 2002:a17:902:694c:b029:db:d939:1061 with SMTP id k12-20020a170902694cb02900dbd9391061mr1149527plt.80.1607558038005; Wed, 09 Dec 2020 15:53:58 -0800 (PST) Received: from localhost.localdomain ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id s7sm4047693pfh.207.2020.12.09.15.53.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 15:53:57 -0800 (PST) From: Ajit Khaparde X-Google-Original-From: Ajit Khaparde To: dev@dpdk.org Cc: Kalesh AP , stable@dpdk.org, Somnath Kotur Date: Wed, 9 Dec 2020 15:53:34 -0800 Message-Id: <20201209235347.16180-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209235347.16180-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> <20201209235347.16180-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 04/17] net/bnxt: release hwrm lock in the error case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP In __bnxt_hwrm_func_qcaps, when memory allocations fails driver is not releasing the hwrm lock. This patch fixes it by calling hwrm_unlock in that error case. Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index ebbf504c0..784e9778a 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -718,6 +718,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) sizeof(bp->pf->vf_info[0]) * new_max_vfs, 0); if (bp->pf->vf_info == NULL) { PMD_DRV_LOG(ERR, "Alloc vf info fail\n"); + HWRM_UNLOCK(); return -ENOMEM; } bp->pf->max_vfs = new_max_vfs; -- 2.21.1 (Apple Git-122.3)