[v2,1/8] net/nfp: fix resource leak of secondary process

Message ID 20240419052349.1294696-2-chaoyong.he@corigine.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series [v2,1/8] net/nfp: fix resource leak of secondary process |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He April 19, 2024, 5:23 a.m. UTC
  Fix one resource leak problem in the abnormal logic of secondary process.

Fixes: 016141b18b3a ("net/nfp: refactor secondary process probe")
Cc: stable@dpdk.org

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

Patch

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index b711e15b9f..98d8e87028 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -2123,7 +2123,7 @@  nfp_pf_secondary_init(struct rte_pci_device *pci_dev)
 	if (sym_tbl == NULL) {
 		PMD_INIT_LOG(ERR, "Something is wrong with the firmware symbol table");
 		ret = -EIO;
-		goto sync_free;
+		goto cpp_cleanup;
 	}
 
 	/* Read the app ID of the firmware loaded */
@@ -2171,6 +2171,8 @@  nfp_pf_secondary_init(struct rte_pci_device *pci_dev)
 
 sym_tbl_cleanup:
 	free(sym_tbl);
+cpp_cleanup:
+	nfp_cpp_free(cpp);
 sync_free:
 	nfp_sync_free(sync);
 pf_cleanup: