[PATCH v3 1/3] net/ice: fix possible memory leak

Medvedkin, Vladimir vladimir.medvedkin at intel.com
Mon Jul 22 13:00:39 CEST 2024



-----Original Message-----
From: Richardson, Bruce <bruce.richardson at intel.com> 
Sent: Monday, July 22, 2024 11:42 AM
To: Medvedkin, Vladimir <vladimir.medvedkin at intel.com>
Cc: dev at dpdk.org; stable at dpdk.org; Stolarchuk, Michael <mike.stolarchuk at arista.com>
Subject: Re: [PATCH v3 1/3] net/ice: fix possible memory leak

On Mon, Jul 22, 2024 at 08:28:34AM +0000, Vladimir Medvedkin wrote:
> This patch fixes possible memory leak inside the
> ice_hash_parse_raw_pattern() due to the lack of a call to rte_free() 
> for previously allocated pkt_buf and msk_buf.
> 
> Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow 
> offloading in RSS")
> Cc: stable at dpdk.org
> 
> Reported-by: Michael Theodore Stolarchuk <mike.stolarchuk at arista.com>
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
> ---
>  drivers/net/ice/ice_hash.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 

<snip>

> -	if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt))
> -		return -rte_errno;
> +	ret = ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt);
> +	if (ret)
> +		goto free_mem;
>  
> -	if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
> -		pkt_len, ICE_BLK_RSS, true, &prof))
> -		return -rte_errno;
> +	ret = ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
> +			pkt_len, ICE_BLK_RSS, true, &prof);
> +		goto free_mem;

Are we not still missing an "if (ret != 0)" here?
If so, I can just add on apply.

That's correct, will send v4 

/Bruce



More information about the dev mailing list