]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 21 Dec 2020 11:27:31 +0000 (19:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Jan 2021 12:59:00 +0000 (13:59 +0100)
commit26cf873f3caab3b3d479795ab52cb1dbe350b66d
tree65f908009c621aa437fa6d090a8540868ac4648f
parentc9f32688989125e8a7bbcbdc56992ebda9012be7
net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups

commit 5b0bb12c58ac7d22e05b5bfdaa30a116c8c32e32 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: 33cfaaa8f36f ("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>
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c