From: Jay Ding Date: Wed, 17 Jul 2019 10:41:39 +0000 (+0530) Subject: net/bnxt: check invalid VNIC id for firmware X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e1e5e812f1415b0698f82b4b0fbeb558f3cd7eae;p=dpdk.git net/bnxt: check invalid VNIC id for firmware Add checking for vnic id before sending message to chimp in bnxt_hwrm_vnic_plcmode_cfg(). Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure") Cc: stable@dpdk.org Signed-off-by: Jay Ding Signed-off-by: Ajit Khaparde Reviewed-by: Randy Schacher --- diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index a4e0c2e0cc..313459aaf9 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1497,6 +1497,11 @@ static int bnxt_hwrm_vnic_plcmodes_cfg(struct bnxt *bp, struct hwrm_vnic_plcmodes_cfg_input req = {.req_type = 0 }; struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr; + if (vnic->fw_vnic_id == INVALID_HW_RING_ID) { + PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id); + return rc; + } + HWRM_PREP(req, VNIC_PLCMODES_CFG, BNXT_USE_CHIMP_MB); req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);