All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown()
@ 2026-09-03 10:43 Zhixing Chen
  2026-09-09  4:44 ` Emil Tsalapatis
  2026-09-12 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Zhixing Chen @ 2026-09-03 10:43 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
	Zhixing Chen

xdp_test_run_setup() allocates xdp->frames and xdp->skbs with
kvmalloc_array(). The setup error path already releases both arrays with
kvfree(), while the normal teardown path still uses kfree().

Use kvfree() in xdp_test_run_teardown() as well, so the release helper
matches the allocator on both paths.

Signed-off-by: Zhixing Chen <running910@gmail.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 5d51f6cb7d15..513354e928cb 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -205,8 +205,8 @@ static void xdp_test_run_teardown(struct xdp_test_data *xdp)
 {
 	xdp_unreg_mem_model(&xdp->mem);
 	page_pool_destroy(xdp->pp);
-	kfree(xdp->frames);
-	kfree(xdp->skbs);
+	kvfree(xdp->frames);
+	kvfree(xdp->skbs);
 }
 
 static bool frame_was_changed(const struct xdp_page_head *head)

base-commit: 7bf591f26545f5776a4e42d08c06fd94469766dd
-- 
2.34.1


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

* Re: [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown()
  2026-09-03 10:43 [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown() Zhixing Chen
@ 2026-09-09  4:44 ` Emil Tsalapatis
  2026-09-12 19:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2026-09-09  4:44 UTC (permalink / raw)
  To: Zhixing Chen
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau

On Thu, Sep 3, 2026 at 6:56 AM Zhixing Chen <running910@gmail.com> wrote:
>
> xdp_test_run_setup() allocates xdp->frames and xdp->skbs with
> kvmalloc_array(). The setup error path already releases both arrays with
> kvfree(), while the normal teardown path still uses kfree().
>
> Use kvfree() in xdp_test_run_teardown() as well, so the release helper
> matches the allocator on both paths.
>
> Signed-off-by: Zhixing Chen <running910@gmail.com>
> ---

Reviewed-by: Emil Tsalapatis <emil@etsalapatis.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 5d51f6cb7d15..513354e928cb 100644
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -205,8 +205,8 @@ static void xdp_test_run_teardown(struct xdp_test_data *xdp)
>  {
>         xdp_unreg_mem_model(&xdp->mem);
>         page_pool_destroy(xdp->pp);
> -       kfree(xdp->frames);
> -       kfree(xdp->skbs);
> +       kvfree(xdp->frames);
> +       kvfree(xdp->skbs);
>  }
>
>  static bool frame_was_changed(const struct xdp_page_head *head)
>
> base-commit: 7bf591f26545f5776a4e42d08c06fd94469766dd
> --
> 2.34.1
>
>

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

* Re: [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown()
  2026-09-03 10:43 [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown() Zhixing Chen
  2026-09-09  4:44 ` Emil Tsalapatis
@ 2026-09-12 19:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-12 19:20 UTC (permalink / raw)
  To: Zhixing Chen; +Cc: bpf, ast, daniel, andrii, eddyz87, memxor, martin.lau

Hello:

This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu,  3 Sep 2026 18:43:58 +0800 you wrote:
> xdp_test_run_setup() allocates xdp->frames and xdp->skbs with
> kvmalloc_array(). The setup error path already releases both arrays with
> kvfree(), while the normal teardown path still uses kfree().
> 
> Use kvfree() in xdp_test_run_teardown() as well, so the release helper
> matches the allocator on both paths.
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: Use kvfree() in xdp_test_run_teardown()
    https://git.kernel.org/bpf/bpf/c/7d70a0b02d26

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

end of thread, other threads:[~2026-09-12 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 10:43 [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown() Zhixing Chen
2026-09-09  4:44 ` Emil Tsalapatis
2026-09-12 19:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.