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: [email protected]
>
> Reported-by: Michael Theodore Stolarchuk <[email protected]>
> Signed-off-by: Vladimir Medvedkin <[email protected]>
> ---
> 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