net/mlx5: use kvfree() for kvzalloc() in mlx5_ct_fs_smfs_matcher_create
authorZiyang Xuan <william.xuanziyang@huawei.com>
Wed, 20 Apr 2022 10:36:17 +0000 (18:36 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 3 May 2022 04:21:10 +0000 (21:21 -0700)
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>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c

index 59988e2..b979826 100644 (file)
@@ -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);