Skip to content

Commit 884abe4

Browse files
zhengchaoshaoSaeed Mahameed
authored andcommitted
net/mlx5e: fix double free in mlx5e_destroy_flow_table
In function accel_fs_tcp_create_groups(), when the ft->g memory is successfully allocated but the 'in' memory fails to be allocated, the memory pointed to by ft->g is released once. And in function accel_fs_tcp_create_table, mlx5e_destroy_flow_table is called to release the memory pointed to by ft->g again. This will cause double free problem. Fixes: c062d52 ("net/mlx5e: Receive flow steering framework for accelerated TCP flows") Signed-off-by: Zhengchao Shao <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent c451410 commit 884abe4

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static int accel_fs_tcp_create_groups(struct mlx5e_flow_table *ft,
190190
in = kvzalloc(inlen, GFP_KERNEL);
191191
if (!in || !ft->g) {
192192
kfree(ft->g);
193+
ft->g = NULL;
193194
kvfree(in);
194195
return -ENOMEM;
195196
}

0 commit comments

Comments
 (0)