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 3B75DA04DB; Wed, 9 Dec 2020 20:24:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D81DC9C0; Wed, 9 Dec 2020 20:22:51 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id C77BFC968; Wed, 9 Dec 2020 20:22:45 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id 131so1659734pfb.9; Wed, 09 Dec 2020 11:22:45 -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=AD1IVqMN3njHpayl10EZ5wD6Trb8FeMV1D95kfotjt85ROQKab+6vE6u3+3OM67Psk 8pAQOOQs6K4DskXn8djs71RDizk06D05DGT9Mu5v8xqdU6I12hzX+sDD/2E5fan94a7M fzuq8oFa4oAFh074X87+JJstzrSBeEI4T4KYnYaFmijtRy0buuzoQ/XlEgdlxi6+W+vz ileiECxcjr/7L/NkcfutoylVQY7KRyYztf8o8+FKm4RkhBuYpOnZZ4BTHWJuP7btPuVG 2avSLbFfRexjZH/Dl/NCs2HqBKPxhJsWAqyCqflUge8hmR9Sa/HJHYPt++VmrNrDgoSz RAdQ== 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=VpqK0tH0Hkyx2FPpp3yXilnIsqkQfUqi3woM2Bk3uCXBDneo0EMb0+ynwuM3bImRKi z21fzLn4K2TzgMWbTgbXtELudRdACFuQdUlJTd9qwAbG63THPWl12qSLO8VviVfq/iO0 nJweylYb+fvORhR/57+ueqOWxDa2Is+fXuY5Zh/0qgj9lqQ7jDvoY1CieYu7npIcbTxO v1vhdPv2jag8I8yniz/BnDzJfNF9aaq+pCIfDQnUNaDyJbiB8r3TwXpnxyZ1AA4hp+5M +3suv+4EOC/sJaOrI44MAQapojlPb865pdQDbutPBd7APjJjIoqvME4fZl5Mg5+G+rif 8bVw== X-Gm-Message-State: AOAM531AFo7Taqvc3N6cvz0MQoD31XTa7yhX4QRO03DHrheBE4yqk6a/ Hm9mFGRbu3cIAwtPjOr71RiPpxxMnXGN1ytP X-Google-Smtp-Source: ABdhPJxVl4Rp5A3RAHmmc3kYC2yGC61MAmKUr2zyXzRX97pXHlziwm/erK1R9MHUphzF0of3jnxMVg== X-Received: by 2002:a17:90a:9e5:: with SMTP id 92mr3607022pjo.176.1607541763622; Wed, 09 Dec 2020 11:22:43 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y1sm3342449pfe.80.2020.12.09.11.22.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 11:22:43 -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 11:22:20 -0800 Message-Id: <20201209192233.6518-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209192233.6518-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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)