]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Check valid VNIC ID in bnxt_hwrm_vnic_set_tpa().
authorMichael Chan <michael.chan@broadcom.com>
Sat, 10 Mar 2018 04:46:10 +0000 (23:46 -0500)
committerBrian Maly <brian.maly@oracle.com>
Wed, 27 Feb 2019 19:46:55 +0000 (14:46 -0500)
Orabug: 29357977

During initialization, if we encounter errors, there is a code path that
calls bnxt_hwrm_vnic_set_tpa() with invalid VNIC ID.  This may cause a
warning in firmware logs.

Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3c4fe80b32c685bdc02b280814d0cfe80d441c72)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 26bdd148e7b5bc10db08092c8301713698f8952f..700c4e7cbe98818fc92ba673fba731c6b367f879 100644 (file)
@@ -3826,6 +3826,9 @@ static int bnxt_hwrm_vnic_set_tpa(struct bnxt *bp, u16 vnic_id, u32 tpa_flags)
        struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id];
        struct hwrm_vnic_tpa_cfg_input req = {0};
 
+       if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
+               return 0;
+
        bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_VNIC_TPA_CFG, -1, -1);
 
        if (tpa_flags) {