[PATCH v4 04/17] net/dpaa2: fix resource leak on softparser failure

Maxime Leroy
2026-03-25T20:46:18Z

When soft parser loading or enabling fails during probe, the error
path returns directly instead of going through the init_err label.
This skips dpaa2_dev_close() and leaks all resources allocated during
probe (queues, MAC addresses, extract params).

Fixes: 72ec7a678e70 ("net/dpaa2: add soft parser driver")
Cc: stable@dpdk.org

Signed-off-by: Maxime Leroy <maxime@leroys.fr>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 605c75ad70..5e0a897ed3 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -3165,7 +3165,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
if (ret < 0) {
DPAA2_PMD_ERR(" Error(%d) in loading softparser",
ret);
- return ret;
+ goto init_err;
}

ret = dpaa2_eth_enable_wriop_soft_parser(priv,
@@ -3173,7 +3173,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
if (ret < 0) {
DPAA2_PMD_ERR(" Error(%d) in enabling softparser",
ret);
- return ret;
+ goto init_err;
}
}

--
2.43.0