]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix two double free cases
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 28 Dec 2020 08:48:40 +0000 (16:48 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 7 Jan 2021 20:22:50 +0000 (12:22 -0800)
commit532596fd66a5a80fb9d52ec364f64b27c16d8443
tree1d00030f40ecbe7eee97563a11d9c9c16b0435da
parent657e94bde83f06f838af487c14284b5d2412916a
net/mlx5e: Fix two double free cases

mlx5e_create_ttc_table_groups() frees ft->g on failure of
kvzalloc(), but such failure will be caught by its caller
in mlx5e_create_ttc_table() and ft->g will be freed again
in mlx5e_destroy_flow_table(). The same issue also occurs
in mlx5e_create_ttc_table_groups(). Set ft->g to NULL after
kfree() to avoid double free.

Fixes: 3aa1f6903b9b ("net/mlx5e: Support RSS for GRE tunneled packets")
Fixes: 5c6b620f0fbf ("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>
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c