netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc()
@ 2022-03-10  9:28 Yihao Han
  2022-03-10 15:20 ` patchwork-bot+netdevbpf
  2022-03-10 15:23 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Yihao Han @ 2022-03-10  9:28 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Jesper Dangaard Brouer,
	netdev, bpf, linux-kernel
  Cc: kernel, Yihao Han

It is allocated with kvmalloc(), the corresponding release function
should not be kfree(), use vfree() instead.

Generated by: scripts/coccinelle/api/kfree_mismatch.cocci

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 net/bpf/test_run.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 25169908be4a..b7e1e5f61c50 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -196,9 +196,9 @@ static int xdp_test_run_setup(struct xdp_test_data *xdp, struct xdp_buff *orig_c
 err_mmodel:
 	page_pool_destroy(pp);
 err_pp:
-	kfree(xdp->skbs);
+	kvfree(xdp->skbs);
 err_skbs:
-	kfree(xdp->frames);
+	kvfree(xdp->frames);
 	return err;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc()
  2022-03-10  9:28 [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc() Yihao Han
@ 2022-03-10 15:20 ` patchwork-bot+netdevbpf
  2022-03-10 15:23 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-10 15:20 UTC (permalink / raw)
  To: Yihao Han
  Cc: davem, kuba, ast, daniel, andrii, kafai, songliubraving, yhs,
	john.fastabend, kpsingh, hawk, netdev, bpf, linux-kernel, kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Thu, 10 Mar 2022 01:28:27 -0800 you wrote:
> It is allocated with kvmalloc(), the corresponding release function
> should not be kfree(), use vfree() instead.
> 
> Generated by: scripts/coccinelle/api/kfree_mismatch.cocci
> 
> Signed-off-by: Yihao Han <hanyihao@vivo.com>
> 
> [...]

Here is the summary with links:
  - bpf: test_run: use kvfree() for memory allocated with kvmalloc()
    https://git.kernel.org/bpf/bpf-next/c/2fe145de5ba3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc()
  2022-03-10  9:28 [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc() Yihao Han
  2022-03-10 15:20 ` patchwork-bot+netdevbpf
@ 2022-03-10 15:23 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2022-03-10 15:23 UTC (permalink / raw)
  To: Yihao Han, David S. Miller, Jakub Kicinski, Alexei Starovoitov,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Jesper Dangaard Brouer, netdev, bpf,
	linux-kernel
  Cc: kernel, toke

[ You have plenty of folks in Cc, just not Toke given b530e9e1063e, so added him. ;) ]

On 3/10/22 10:28 AM, Yihao Han wrote:
> It is allocated with kvmalloc(), the corresponding release function
> should not be kfree(), use vfree() instead.

nit: s/vfree/kvfree/

> Generated by: scripts/coccinelle/api/kfree_mismatch.cocci

Fixed up typo and added Fixes tag before pushing, thanks!

> Signed-off-by: Yihao Han <hanyihao@vivo.com>
> ---
>   net/bpf/test_run.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> index 25169908be4a..b7e1e5f61c50 100644
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -196,9 +196,9 @@ static int xdp_test_run_setup(struct xdp_test_data *xdp, struct xdp_buff *orig_c
>   err_mmodel:
>   	page_pool_destroy(pp);
>   err_pp:
> -	kfree(xdp->skbs);
> +	kvfree(xdp->skbs);
>   err_skbs:
> -	kfree(xdp->frames);
> +	kvfree(xdp->frames);
>   	return err;
>   }
>   
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-10 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10  9:28 [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc() Yihao Han
2022-03-10 15:20 ` patchwork-bot+netdevbpf
2022-03-10 15:23 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).