diff options
| author | Cosmin Ratiu <cratiu@nvidia.com> | 2024-12-03 22:49:15 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 20:03:09 +0100 |
| commit | 1af1342724bdedadf88b9926eb6c2eec5d342fc9 (patch) | |
| tree | 471c444eebc6428b58f198cc0b1716d412aed1b6 | |
| parent | 177b72ed7c77b11e46dd4336d73a87a77a5603af (diff) | |
| download | linux-1af1342724bdedadf88b9926eb6c2eec5d342fc9.tar.gz linux-1af1342724bdedadf88b9926eb6c2eec5d342fc9.tar.bz2 linux-1af1342724bdedadf88b9926eb6c2eec5d342fc9.zip | |
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@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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 601fad5fc54a..ee4058bafe11 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); |
