Skip to content

Commit

Permalink
net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()
Browse files Browse the repository at this point in the history
'accel_tcp' is allocted by kvzalloc() now, which is a small chunk.
Use kzalloc() directly instead of kvzalloc().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
YueHaibing authored and Saeed Mahameed committed Jan 11, 2023
1 parent 4238654 commit 96c31b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void mlx5e_accel_fs_tcp_destroy(struct mlx5e_flow_steering *fs)
for (i = 0; i < ACCEL_FS_TCP_NUM_TYPES; i++)
accel_fs_tcp_destroy_table(fs, i);

kvfree(accel_tcp);
kfree(accel_tcp);
mlx5e_fs_set_accel_tcp(fs, NULL);
}

Expand All @@ -377,7 +377,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs)
if (!MLX5_CAP_FLOWTABLE_NIC_RX(mlx5e_fs_get_mdev(fs), ft_field_support.outer_ip_version))
return -EOPNOTSUPP;

accel_tcp = kvzalloc(sizeof(*accel_tcp), GFP_KERNEL);
accel_tcp = kzalloc(sizeof(*accel_tcp), GFP_KERNEL);
if (!accel_tcp)
return -ENOMEM;
mlx5e_fs_set_accel_tcp(fs, accel_tcp);
Expand All @@ -397,7 +397,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs)
err_destroy_tables:
while (--i >= 0)
accel_fs_tcp_destroy_table(fs, i);
kvfree(accel_tcp);
kfree(accel_tcp);
mlx5e_fs_set_accel_tcp(fs, NULL);
return err;
}

0 comments on commit 96c31b5

Please sign in to comment.