This is a note to let you know that I've just added the patch titled net/mlx5: HWS: Fix memory leak in mlx5hws_definer_calc_layout to the 6.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mlx5-hws-fix-memory-leak-in-mlx5hws_definer_calc.patch and it can be found in the queue-6.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 8cc84cd2c364b48fc84e868bc50e360273a4a51e Author: Cosmin Ratiu <cratiu@xxxxxxxxxx> Date: Tue Dec 3 22:49:15 2024 +0200 net/mlx5: HWS: Fix memory leak in mlx5hws_definer_calc_layout [ Upstream commit 530b69a26952c95ffc9e6dcd1cff6f249032780a ] It allocates a match template, which creates a compressed definer fc struct, but that is not deallocated. This commit fixes that. Fixes: 74a778b4a63f ("net/mlx5: HWS, added definers handling") Signed-off-by: Cosmin Ratiu <cratiu@xxxxxxxxxx> Reviewed-by: Yevgeny Kliteynik <kliteyn@xxxxxxxxxx> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx> Link: https://patch.msgid.link/20241203204920.232744-2-tariqt@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c index 601fad5fc54a3..ee4058bafe119 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c @@ -39,6 +39,8 @@ bool mlx5hws_bwc_match_params_is_complex(struct mlx5hws_context *ctx, } else { mlx5hws_err(ctx, "Failed to calculate matcher definer layout\n"); } + } else { + kfree(mt->fc); } mlx5hws_match_template_destroy(mt);