net/mlx5e: fix a double-free in arfs_create_groups
authorZhipeng Lu <alexious@zju.edu.cn>
Wed, 17 Jan 2024 07:17:36 +0000 (15:17 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 24 Jan 2024 08:15:38 +0000 (00:15 -0800)
commit3c6d5189246f590e4e1f167991558bdb72a4738b
tree7d6bebd3b38c73fa94bdc567eb06ca995f665c79
parent315a597f9bcfe7fe9980985031413457bee95510
net/mlx5e: fix a double-free in arfs_create_groups

When `in` allocated by kvzalloc fails, arfs_create_groups will free
ft->g and return an error. However, arfs_create_table, the only caller of
arfs_create_groups, will hold this error and call to
mlx5e_destroy_flow_table, in which the ft->g will be freed again.

Fixes: 1cabe6b0965e ("net/mlx5e: Create aRFS flow tables")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c