On Tue, Oct 27, 2026 at 10:51:31AM +0000, Anurag Mandal wrote:
> When ice_init_hw_tbls() fails, ice_dev_init() frees the DDP package
> copy but leaves hw->pkg_copy and hw->seg pointing into it. Without
> safe mode, the error path then calls ice_deinit_hw(), which frees
> the package copy again through ice_free_seg().
>
> Use ice_free_seg(), which also clears these pointers.
>
> Fixes: 9c4f15901ada ("net/ice: free memory with matching allocator")
>
> Signed-off-by: Anurag Mandal <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
> ---
> drivers/net/intel/ice/ice_ethdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/intel/ice/ice_ethdev.c
> b/drivers/net/intel/ice/ice_ethdev.c
> index b846555b97..dd3a4976ab 100644
> --- a/drivers/net/intel/ice/ice_ethdev.c
> +++ b/drivers/net/intel/ice/ice_ethdev.c
> @@ -2785,7 +2785,7 @@ ice_dev_init(struct rte_eth_dev *dev)
> ret = ice_init_hw_tbls(hw);
> if (ret) {
> PMD_INIT_LOG(ERR, "ice_init_hw_tbls failed: %d", ret);
> - ice_free(hw, hw->pkg_copy);
> + ice_free_seg(hw);
> }
> }
>
> --
> 2.25.1
>
- [PATCH 6/7] net/ice: fix FDIR resource leak on setup fail... Anurag Mandal
- Re: [PATCH 6/7] net/ice: fix FDIR resource leak on s... Bruce Richardson
- [PATCH 7/7] net/ice: fix ACL profile segment leak Anurag Mandal
- Re: [PATCH 7/7] net/ice: fix ACL profile segment lea... Bruce Richardson
- [PATCH 3/7] net/ice: fix DDP filename leak Anurag Mandal
- Re: [PATCH 3/7] net/ice: fix DDP filename leak Bruce Richardson
- [PATCH 5/7] net/ice: fix MAC and VLAN filter leak on VSI ... Anurag Mandal
- Re: [PATCH 5/7] net/ice: fix MAC and VLAN filter lea... Bruce Richardson
- Re: [PATCH 0/7] net/ice: fix memory leaks Bruce Richardson
- [PATCH 1/7] net/ice: fix DDP package double free on init ... Anurag Mandal
- Re: [PATCH 1/7] net/ice: fix DDP package double free... Bruce Richardson
- Re: [PATCH 1/7] net/ice: fix DDP package double ... Bruce Richardson
- [PATCH 4/7] net/ice: fix main VSI leak on init failure Anurag Mandal
- Re: [PATCH 4/7] net/ice: fix main VSI leak on init f... Bruce Richardson
- [PATCH v2 0/7] net/ice: fix memory leaks Anurag Mandal
- [PATCH v2 4/7] net/ice: fix main VSI leak on init fa... Anurag Mandal
- [PATCH v2 6/7] net/ice: fix FDIR resource leak on se... Anurag Mandal
- [PATCH v2 2/7] net/ice: fix resource leaks on port c... Anurag Mandal

