net/ice: fix NULL dereference on ACL init failure
PATCH 1/1 net/ice: fix NULL dereference on ACL init failure
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")
Signed-off-by Anurag Mandal <[email protected]>
--- drivers/net/intel/ice/ice_acl_filter.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/intel/ice/ice_acl_filter.c +3 -0
@@ -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]);
Signature · 1 line
2.25.1
Quoted 9 lines · Anurag Mandal
If
ice_acl_init()fails to allocate the ACL profile array, it leaveshw->acl_profNULL.ice_flow_init()then fails andice_dev_init()callsice_flow_uninit(), whereice_acl_prof_free()dereferences the NULL array.Return early from
ice_acl_prof_free()when the array was never allocated.
Quoted 9 lines
Fixes 40d466fa9f76 ("net/ice: support ACL filter in DCF")Fixes 96b25c496aad ("net/ice: fix memzone leak after device init failure")Signed-off-by Anurag Mandal <[email protected]>--- drivers/net/intel/ice/ice_acl_filter.c | 3 +++ 1 file changed, 3 insertions(+)
Acked-by Bruce Richardson <[email protected]>
Applied to dpdk-next-net-intel.
Thanks,
/Bruce