Re: [PATCH net] net/mlx5: HWS, fix matcher leak on resize target setup failure

From: Tariq Toukan

Date: Wed Jul 01 2026 - 15:02:48 EST




On 01/07/2026 17:38, Paolo Abeni wrote:
On 6/29/26 8:40 AM, Dawei Feng wrote:
hws_bwc_matcher_move() allocates a replacement matcher before setting it
as the resize target. If mlx5hws_matcher_resize_set_target() fails, the
replacement matcher is not attached anywhere and is leaked.

Fix the leak by destroying the replacement matcher before returning from
the resize-target failure path.

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still
present in v7.1.1.

An x86_64 allyesconfig build showed no new warnings. As we do not have a
mlx5 HWS-capable device to test with, no runtime testing was able to be
performed.

Fixes: 2111bb970c78 ("net/mlx5: HWS, added backward-compatible API handling")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Dawei Feng <dawei.feng@xxxxxxxxxx>

@nvidia team, double checking I did not miss any relevant communication.
The last process update I recall is that one of the people listed in
maintainer file will ack patches for us to merge directly into the
net/net-next trees.


Ack.

Should we consider any ack from @nvidia sufficient to take over?

Thanks,

Paolo



Acked-by: Tariq Toukan <tariqt@xxxxxxxxxx>