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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:03 +0000 (16:19 -0800)
commitb21db3f1ab7967a81d6bbd328d28fe5a4c07a8a7
treefd676f98b422ede808c76b8f2bf0707c1b89b8af
parent5fe8c422eb05d71acf287f3e798261379025ea85
net/mlx5e: fix a double-free in arfs_create_groups

[ Upstream commit 3c6d5189246f590e4e1f167991558bdb72a4738b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c