1
0
Fork 0

net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups

commit 5b0bb12c58 upstream.

When mlx5_create_flow_group() fails, ft->g should be
freed just like when kvzalloc() fails. The caller of
mlx5e_create_l2_table_groups() does not catch this
issue on failure, which leads to memleak.

Fixes: 33cfaaa8f3 ("net/mlx5e: Split the main flow steering table")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Dinghao Liu 2020-12-21 19:27:31 +08:00 committed by Greg Kroah-Hartman
parent a2b2ae3812
commit ce74b5a068
1 changed files with 1 additions and 0 deletions

View File

@ -1346,6 +1346,7 @@ err_destroy_groups:
ft->g[ft->num_groups] = NULL;
mlx5e_destroy_groups(ft);
kvfree(in);
kfree(ft->g);
return err;
}