patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: stable@dpdk.org
Cc: luca.boccassi@gmail.com, ajit.khaparde@broadcom.com
Subject: [dpdk-stable] [PATCH 19.11 1/3] net/bnxt: fix return code handling in VLAN config
Date: Fri, 28 Feb 2020 13:43:57 +0530	[thread overview]
Message-ID: <20200228081359.7578-2-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20200228081359.7578-1-kalesh-anakkur.purayil@broadcom.com>

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

[ upstream commit 74f96ffdc1cfbff3464f87f9e6b280e52da794e2 ]

return value stored in "ret" but it has been overwritten before use.

Coverity issue: 353621
Fixes: 7fe5668d2ea3 ("net/bnxt: support VLAN filter and strip")
Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f3107b6..e6515ff 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1924,9 +1924,15 @@ bnxt_config_vlan_hw_stripping(struct bnxt *bp, uint64_t rx_offloads)
 	if (bp->eth_dev->data->dev_conf.rxmode.offloads &
 	    DEV_RX_OFFLOAD_VLAN_FILTER) {
 		rc = bnxt_add_vlan_filter(bp, 0);
-		bnxt_restore_vlan_filters(bp);
+		if (rc)
+			return rc;
+		rc = bnxt_restore_vlan_filters(bp);
+		if (rc)
+			return rc;
 	} else {
 		rc = bnxt_add_mac_filter(bp, vnic, NULL, 0, 0);
+		if (rc)
+			return rc;
 	}
 
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
@@ -3930,10 +3936,16 @@ static int bnxt_restore_filters(struct bnxt *bp)
 	struct rte_eth_dev *dev = bp->eth_dev;
 	int ret = 0;
 
-	if (dev->data->all_multicast)
+	if (dev->data->all_multicast) {
 		ret = bnxt_allmulticast_enable_op(dev);
-	if (dev->data->promiscuous)
+		if (ret)
+			return ret;
+	}
+	if (dev->data->promiscuous) {
 		ret = bnxt_promiscuous_enable_op(dev);
+		if (ret)
+			return ret;
+	}
 
 	ret = bnxt_restore_mac_filters(bp);
 	if (ret)
-- 
2.10.1


  reply	other threads:[~2020-02-28  7:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  8:13 [dpdk-stable] [PATCH 19.11 0/3] bnxt fixes for 19.11 stable Kalesh A P
2020-02-28  8:13 ` Kalesh A P [this message]
2020-02-28  8:13 ` [dpdk-stable] [PATCH 19.11 2/3] net/bnxt: handle HW filter setting when port is stopped Kalesh A P
2020-02-28  8:13 ` [dpdk-stable] [PATCH 19.11 3/3] net/bnxt: remove a redundant variable Kalesh A P
2020-02-28 11:12 ` [dpdk-stable] [PATCH 19.11 0/3] bnxt fixes for 19.11 stable Luca Boccassi

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=20200228081359.7578-2-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=luca.boccassi@gmail.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).