[PATCH v3 1/3] net/ice: fix possible memory leak
Bruce Richardson
bruce.richardson at intel.com
Mon Jul 22 12:41:47 CEST 2024
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.
/Bruce
More information about the stable
mailing list