Skip to content

Commit 530b69a

Browse files
Cosmin Ratiukuba-moo
authored andcommitted
net/mlx5: HWS: Fix memory leak in mlx5hws_definer_calc_layout
It allocates a match template, which creates a compressed definer fc struct, but that is not deallocated. This commit fixes that. Fixes: 74a778b ("net/mlx5: HWS, added definers handling") Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20241203204920.232744-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 5f4d035 commit 530b69a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core/steering/hws

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ bool mlx5hws_bwc_match_params_is_complex(struct mlx5hws_context *ctx,
3939
} else {
4040
mlx5hws_err(ctx, "Failed to calculate matcher definer layout\n");
4141
}
42+
} else {
43+
kfree(mt->fc);
4244
}
4345

4446
mlx5hws_match_template_destroy(mt);

0 commit comments

Comments
 (0)