]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:29:39 +0000 (10:29 +0200)
[ Upstream commit c389362096be8ee69ec3a163a0699a31e84b8451 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c

index bec9ed0103a939d23dc57666ea40cd80e57ce3ad..2b80fe73549d2d2367853311a15fa36254a2bf39 100644 (file)
@@ -101,7 +101,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);