[PATCH v2 2/8] net/ice: fix DCF parent adapter init error path
Anurag Mandal
anurag.mandal at intel.com
Sun Nov 8 00:52:12 CET 2026
ice_dcf_init_parent_adapter() allocates a dummy main VSI
first, but none of its error paths free it.
When ice_flow_init() fails, the error path also skips
ice_flow_uninit(), so the DDP parser and any flow engine
state set up before the failure are not released.
Free the main VSI on all error paths, and call
ice_flow_uninit() when flow init fails.
Fixes: 0b02c9519432 ("net/ice: handle PF initialization by DCF")
Fixes: 829c3106812d ("net/ice: enable switch flow on DCF")
Cc: stable at dpdk.org
Signed-off-by: Anurag Mandal <anurag.mandal at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/intel/ice/ice_dcf_parent.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/intel/ice/ice_dcf_parent.c b/drivers/net/intel/ice/ice_dcf_parent.c
index e6398205ce..d5d37f8810 100644
--- a/drivers/net/intel/ice/ice_dcf_parent.c
+++ b/drivers/net/intel/ice/ice_dcf_parent.c
@@ -457,7 +457,7 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev)
if (err) {
PMD_INIT_LOG(ERR, "failed to init the DCF parent hardware with error %d",
err);
- return err;
+ goto free_vsi;
}
if (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_QOS) {
@@ -491,7 +491,7 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev)
err = ice_flow_init(parent_adapter);
if (err) {
PMD_INIT_LOG(ERR, "Failed to initialize flow");
- goto uninit_hw;
+ goto uninit_flow;
}
mac = (const struct rte_ether_addr *)hw->avf.mac.addr;
@@ -504,8 +504,13 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev)
return 0;
+uninit_flow:
+ ice_flow_uninit(parent_adapter);
uninit_hw:
ice_dcf_uninit_parent_hw(parent_hw);
+free_vsi:
+ rte_free(parent_adapter->pf.main_vsi);
+ parent_adapter->pf.main_vsi = NULL;
return err;
}
--
2.25.1
More information about the stable
mailing list