net/mlx5: Use kfree(ft->g) in arfs_create_groups()
PATCH 1/1 net/mlx5: Use kfree(ft->g) in arfs_create_groups()
Use kfree() instead of kvfree() on ft->g in arfs_create_groups() because the memory is allocated with kcalloc().
--- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +1 -1
@@ -220,7 +220,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft, sizeof(*ft->g), GFP_KERNEL); in =kvzalloc (inlen,GFP_KERNEL );if (!in || !ft->g) { -kvfree (ft->g); +kfree (ft->g);kvfree (in);return -ENOMEM ; }
Signature · 1 line
2.26.2
Quoted 14 lines · Denis Efremov
Use
kfree()instead ofkvfree()onft->ginarfs_create_groups()because the memory is allocated withkcalloc().Signed-off-by Denis Efremov <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +0
-0
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c static int arfs_create_groups(struct mlx5e_flow_table *ft, · line 226
Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +1
-1@@ -220,7 +220,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft, sizeof(*ft->g), GFP_KERNEL); in =kvzalloc (inlen,GFP_KERNEL );if (!in || !ft->g) { -kvfree (ft->g); +kfree (ft->g);kvfree (in);return -ENOMEM ; }
This is slow path, kvfree() is perfectly able to free memory that was kmalloc()ed
net-next is closed, can we avoid these patches during merge window ?
Quoted 31 lines · Eric Dumazet
Quoted 23 lines · Denis Efremov
Use
kfree()instead ofkvfree()onft->ginarfs_create_groups()because
the memory is allocated withkcalloc().Signed-off-by Denis Efremov <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +1
-1@@ -220,7 +220,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft, sizeof(*ft->g), GFP_KERNEL); in =kvzalloc (inlen,GFP_KERNEL );if (!in || !ft->g) { -kvfree (ft->g); +kfree (ft->g);kvfree (in);return -ENOMEM ;Quoted 2 lines
}
This is slow path,
kvfree()is perfectly able to free memory that was kmalloc()ed
Quoted 1 line
net-next is closed, can we avoid these patches during merge window ?
I agree, with Eric, better if we wait for net-next to open.
I will apply this once net-next is open.
Thanks,
Saeed.