dpaa_dev_init() jumped to the free_rx cleanup label without setting ret
when dpaa_port_fmc_init() failed:

        if (num_rx_fqs < 0) {
                DPAA_PMD_ERR("%s FMC initializes failed!", dpaa_intf->name);
                goto free_rx;
        }

ret is still 0 from its initializer at that point, so free_rx returned
success and the port was probed with no Rx queues at all. The adjacent
"not configured by FMC" case already sets -ENODEV before the same goto.

Propagate the error from dpaa_port_fmc_init() instead.

Fixes: f5fe3eed5122 ("net/dpaa: support FMC parser for VSP")
Cc: [email protected]

Signed-off-by: Hemant Agrawal <[email protected]>
---
 drivers/net/dpaa/dpaa_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index a5b02cc9a8..10b90417de 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2259,6 +2259,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
                if (num_rx_fqs < 0) {
                        DPAA_PMD_ERR("%s FMC initializes failed!",
                                dpaa_intf->name);
+                       ret = num_rx_fqs;
                        goto free_rx;
                }
                if (!num_rx_fqs) {
-- 
2.25.1

Reply via email to