]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:44:29 +0000 (16:44 +0100)
commitb1e635e089d883bbad68dbb108c68e11c904047b
tree50c4cfff62775e5193b840d59506d0e0030f1321
parent0387ab3f791c492a7f54cda03d7f07637f1b1514
net/mlx5e: Fix two double free cases

BugLink: https://bugs.launchpad.net/bugs/1913487
commit 7a6eb072a9548492ead086f3e820e9aac71c7138 upstream.

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: 7b3722fa9ef6 ("net/mlx5e: Support RSS for GRE tunneled packets")
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c