From d4d5a04114d46281de21b5a300461628d8000b3c Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Thu, 9 Jul 2020 15:08:28 +0530 Subject: [PATCH] net/bnxt: fix unnecessary memory allocation VFs are not privileged to issue HWRM_PORT_LED_QCFG/CFG. There is no need to allocate "bp->leds" memory. Fixes: 205b74295282 ("net/bnxt: fix allocation of LED config info") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 66ac04b549..712de18696 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -194,6 +194,9 @@ static void bnxt_free_link_info(struct bnxt *bp) static void bnxt_free_leds_info(struct bnxt *bp) { + if (BNXT_VF(bp)) + return; + rte_free(bp->leds); bp->leds = NULL; } @@ -263,6 +266,9 @@ static int bnxt_alloc_link_info(struct bnxt *bp) static int bnxt_alloc_leds_info(struct bnxt *bp) { + if (BNXT_VF(bp)) + return 0; + bp->leds = rte_zmalloc("bnxt_leds", BNXT_MAX_LED * sizeof(struct bnxt_led_info), 0); -- 2.20.1