Message ID | 20220420103617.3006047-1-william.xuanziyang@huawei.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [net] net/mlx5: use kvfree() for kvzalloc() in mlx5_ct_fs_smfs_matcher_create | expand |
On 20 Apr 18:36, Ziyang Xuan wrote: >The memory of spec is allocated with kvzalloc(), the corresponding >release function should not be kfree(), use kvfree() instead. > >Generated by: scripts/coccinelle/api/kfree_mismatch.cocci > >Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> applied to net-next-mlx5, thanks !
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c index 59988e24b704..b979826f3f6c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c @@ -100,7 +100,7 @@ mlx5_ct_fs_smfs_matcher_create(struct mlx5_ct_fs *fs, struct mlx5dr_table *tbl, spec->match_criteria_enable = MLX5_MATCH_MISC_PARAMETERS_2 | MLX5_MATCH_OUTER_HEADERS; dr_matcher = mlx5_smfs_matcher_create(tbl, priority, spec); - kfree(spec); + kvfree(spec); if (!dr_matcher) return ERR_PTR(-EINVAL);
The memory of spec is allocated with kvzalloc(), the corresponding release function should not be kfree(), use kvfree() instead. Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> --- drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)