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

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

CID 353621:  Code maintainability issues  (UNUSED_VALUE)
Fixes: 57813868 ("net/bnxt: fix VLAN strip")
Fixes: df6cd7c1 ("net/bnxt: handle reset notify async event from FW")

Signed-off-by: Kalesh AP <kalesh-anakkur.pura...@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khapa...@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.ko...@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 72e5441..c1cb401 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1956,9 +1956,15 @@ static int bnxt_free_one_vnic(struct bnxt *bp, uint16_t 
vnic_id)
        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);
@@ -3961,10 +3967,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)
-- 
1.8.3.1

Reply via email to