lkml.org 
[lkml]   [2020]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net/mlx5e: Fix two double free cases
On Mon, Dec 21, 2020 at 04:50:31PM +0800, Dinghao Liu wrote:
> 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().
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)

I'm not thrilled to see release in the error flow that will be done in
the different function. The missing piece is "ft->g = NULL" after kfree().

And also fixes lines are missing in all your patches.

Thanks

\
 
 \ /
  Last update: 2020-12-27 09:41    [W:0.069 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site