Skip to content

Commit

Permalink
net/mlx5: use kvfree() for kvzalloc() in mlx5_ct_fs_smfs_matcher_create
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ziyang Xuan authored and Saeed Mahameed committed May 3, 2022
1 parent 0530a68 commit c389362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c389362

Please sign in to comment.