[2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups()
diff mbox series

Message ID 20200921162345.78097-2-efremov@linux.com
State Accepted
Commit e1915a67f64782baf752c7330c3a146b6113040d
Headers show
Series
  • [1/2] net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc()
Related show

Commit Message

Denis Efremov Sept. 21, 2020, 4:23 p.m. UTC
Memory ft->g in accel_fs_tcp_create_groups() is allocaed with kcalloc().
It's excessive to free ft->g with kvfree(). Use kfree() instead.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Saeed Mahameed Sept. 22, 2020, 5:21 a.m. UTC | #1
On Mon, 2020-09-21 at 19:23 +0300, Denis Efremov wrote:
> Memory ft->g in accel_fs_tcp_create_groups() is allocaed with
> kcalloc().
> It's excessive to free ft->g with kvfree(). Use kfree() instead.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
> 

series applied to net-next-mlx5

Patch
diff mbox series

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
index 4cdd9eac647d..97f1594cee11 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
@@ -191,7 +191,7 @@  static int accel_fs_tcp_create_groups(struct mlx5e_flow_table *ft,
 	ft->g = kcalloc(MLX5E_ACCEL_FS_TCP_NUM_GROUPS, sizeof(*ft->g), GFP_KERNEL);
 	in = kvzalloc(inlen, GFP_KERNEL);
 	if  (!in || !ft->g) {
-		kvfree(ft->g);
+		kfree(ft->g);
 		kvfree(in);
 		return -ENOMEM;
 	}