[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8e7a73ed-1488-4d13-807c-f17c04c160e7@bootlin.com>
Date: Fri, 23 Jan 2026 09:09:38 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Zilin Guan <zilin@....edu.cn>, marcin.s.wojtas@...il.com
Cc: linux@...linux.org.uk, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org, jianhao.xu@....edu.cn
Subject: Re: [PATCH net v2] net: mvpp2: cls: Fix memory leak in
mvpp2_ethtool_cls_rule_ins()
Hi,
On 23/01/2026 07:57, Zilin Guan wrote:
> In mvpp2_ethtool_cls_rule_ins(), the ethtool_rule is allocated by
> ethtool_rx_flow_rule_create(). If the subsequent conversion to flow
> type fails, the function jumps to the clean_rule label.
>
> However, the clean_rule label only frees efs, skipping the cleanup
> of ethtool_rule, which leads to a memory leak.
>
> Fix this by jumping to the clean_eth_rule label, which properly calls
> ethtool_rx_flow_rule_destroy() before freeing efs.
>
> Compile tested only. Issue found using a prototype static analysis tool
> and code review.
Thanks for clarifying how you found that
>
> Fixes: f4f1ba18195d ("net: mvpp2: cls: Report an error for unsupported flow types")
> Signed-off-by: Zilin Guan <zilin@....edu.cn>
Change is fine, thanks for fixing this.
Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
Maxime
Powered by blists - more mailing lists