[PATCH 10/10] net/nfp: fix memory leak in VF initialization logic

Chaoyong He chaoyong.he at corigine.com
Thu Oct 10 11:17:16 CEST 2024


Fix one memory leak problem in the logic of VF initialization.

Fixes: d81e2b514dc9 ("net/nfp: move device info into process private data")
Cc: stable at dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
 drivers/net/nfp/nfp_ethdev_vf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index ab413a2c5a..0a25730bf1 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -327,7 +327,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	if (net_hw->eth_xstats_base == NULL) {
 		PMD_INIT_LOG(ERR, "No memory for xstats base values on device %s!",
 				pci_dev->device.name);
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto hw_priv_free;
 	}
 
 	/* Work out where in the BAR the queues start. */
-- 
2.39.1



More information about the dev mailing list