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 <[email protected]> Reviewed-by: Yevgeny Kliteynik <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5f4d035 commit 530b69a

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering/hws

1 file changed

+2
-0
lines changed

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)