[PATCH] net/ice: fix NULL dereference on ACL init failure

Anurag Mandal anurag.mandal at intel.com
Fri Nov 6 07:39:49 CET 2026


If ice_acl_init() fails to allocate the ACL profile array,
it leaves hw->acl_prof NULL.
ice_flow_init() then fails and ice_dev_init() calls
ice_flow_uninit(), where ice_acl_prof_free() dereferences
the NULL array.

Return early from ice_acl_prof_free() when the array was
never allocated.

Fixes: 40d466fa9f76 ("net/ice: support ACL filter in DCF")
Fixes: 96b25c496aad ("net/ice: fix memzone leak after device init failure")
Cc: stable at dpdk.org

Signed-off-by: Anurag Mandal <anurag.mandal at intel.com>
---
 drivers/net/intel/ice/ice_acl_filter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/intel/ice/ice_acl_filter.c b/drivers/net/intel/ice/ice_acl_filter.c
index 6cf8c83738..94c9ea89fd 100644
--- a/drivers/net/intel/ice/ice_acl_filter.c
+++ b/drivers/net/intel/ice/ice_acl_filter.c
@@ -1065,6 +1065,9 @@ ice_acl_prof_free(struct ice_hw *hw)
 {
 	enum ice_fltr_ptype ptype;
 
+	if (hw->acl_prof == NULL)
+		return;
+
 	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
 	     ptype < ICE_FLTR_PTYPE_MAX; ptype++) {
 		ice_free(hw, hw->acl_prof[ptype]);
-- 
2.25.1



More information about the stable mailing list