patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	stable@dpdk.org, Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [dpdk-stable] [PATCH 04/17] net/bnxt: release hwrm lock in the error case
Date: Tue,  8 Dec 2020 12:11:21 -0800	[thread overview]
Message-ID: <20201208201134.47844-5-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20201208201134.47844-1-ajit.khaparde@broadcom.com>

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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 <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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.

  parent reply	other threads:[~2020-12-08 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201208201134.47844-1-ajit.khaparde@broadcom.com>
2020-12-08 20:11 ` [dpdk-stable] [PATCH 01/17] net/bnxt: fix RX rings in RSS redirection table Ajit Khaparde
2020-12-08 20:11 ` [dpdk-stable] [PATCH 02/17] net/bnxt: fix VNIC config on Rx queue stop Ajit Khaparde
2020-12-08 20:11 ` Ajit Khaparde [this message]
2020-12-08 20:11 ` [dpdk-stable] [PATCH 06/17] net/bnxt: fix to return error when fw command fails Ajit Khaparde
2020-12-08 20:11 ` [dpdk-stable] [PATCH 07/17] net/bnxt: fix cleanup on mutex init failure Ajit Khaparde
2020-12-08 20:11 ` [dpdk-stable] [PATCH 08/17] net/bnxt: fix format specifier for unsigned int Ajit Khaparde
2020-12-08 20:11 ` [dpdk-stable] [PATCH 09/17] net/bnxt: fix max rings computation Ajit Khaparde
2020-12-08 20:11 ` [dpdk-stable] [PATCH 13/17] net/bnxt: fix vnic RSS configure function Ajit Khaparde
2020-12-08 20:11 ` [dpdk-stable] [PATCH 14/17] net/bnxt: fix PF resource query Ajit Khaparde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201208201134.47844-5-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).