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 4DC40A09E9; Tue, 8 Dec 2020 21:13:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E6F1C9B4; Tue, 8 Dec 2020 21:11:51 +0100 (CET) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id B5660C988 for ; Tue, 8 Dec 2020 21:11:46 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id t8so14944967pfg.8 for ; Tue, 08 Dec 2020 12:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=K3xgY6GgTDPFAvBJS6YFZwu5OadEEXy9ZSl+l6jbsOs=; b=NYBoKXH+iCXVOexj/t8P6ju7GN6cQTYGqXJnBv9ohQ+K5AgC1X6tlJbJ8W4MFfTsue 7x+pO5xfh2qXJxqrLOqxiD4dHQXRuOZ2yPuw7gYu3RW5PCSVhkbCcu3cnvdMrQf8PzuY +dAObSd58yulSbXoUHAY8OMtKkpfWSjCpnQqc= 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; bh=K3xgY6GgTDPFAvBJS6YFZwu5OadEEXy9ZSl+l6jbsOs=; b=fHeO8sQAa+1XoYBdISnvrRr9vSV9aW0ELnhtaV7DPVTo/NT5EGcYrCkW7WlEjTCRMq cA8hf0w0lbtIiBUU+Cot6kS4ZTp7TL4bIDtYJgIkq4oP1+La5rVAmad0UC0vrEBdtXBH 9/URqLkgYxvAqE9uY70zVgKx8F7nbY5Fmho8H92NoQtHzFoS/vy9fu6O6Kalobua5YHY QQCADLZFhpI5UDLjYZSOD2z/eEAsutUSgeqZvluAci74dw1TiT+98wG7XuOHGeLmcEgZ kjNOgIGf3QPzsp0QrA2qGAzWL3HJnOITeSVTHBbOQ02h+m0/LuPKKyisFa61fj0L0pTS 7NMQ== X-Gm-Message-State: AOAM532294dopBYwjjDozqawpWia7TWViB0qMZ7orD/7FmpJAixOn2+5 cXZW3pD7+3JzRaWAwhm7oxl5OqKTlGXcKZIvDQCr8pGSsvOfylFO6y2Kgcdy/2LQtHne9h2GATw Bmx9xe9TDUGplOk9REoIX0c1lz1DZPENOZrI6sqBWkZkFRHmXq7rcDz7tf0lZKIX+eA== X-Google-Smtp-Source: ABdhPJysnh5hAm9OQ0ZLRVsuMN/R6S+808S98x1qjJCS8Yx2ivhxJSx2pFNx2Aa89JXGNfNnE6jlZw== X-Received: by 2002:aa7:963c:0:b029:19d:dcd3:b2ae with SMTP id r28-20020aa7963c0000b029019ddcd3b2aemr14021806pfg.76.1607458304496; Tue, 08 Dec 2020 12:11:44 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x10sm5729187pfc.157.2020.12.08.12.11.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 12:11:43 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Kalesh AP , stable@dpdk.org, Somnath Kotur Date: Tue, 8 Dec 2020 12:11:21 -0800 Message-Id: <20201208201134.47844-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201208201134.47844-1-ajit.khaparde@broadcom.com> References: <20201208201134.47844-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH 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) -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.