Re: [PATCH net v4] net/mlx5e: fix a double-free in arfs_create_groups

From: Simon Horman
Date: Wed Jan 17 2024 - 04:20:45 EST


On Wed, Jan 17, 2024 at 03:17:36PM +0800, Zhipeng Lu wrote:
> 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@xxxxxxxxxx>
> ---
> Changelog:
>
> v2: free ft->g just in arfs_create_groups with a unwind ladder.
> v3: split the allocation of ft->g and in. Rename the error label.
> remove some refector change in v2.
> v4: correct some space issue.

Thanks for the updates.

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>