BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown()
@ 2026-09-03 10:43 Zhixing Chen
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2026-09-03 10:44 UTC | newest]

Thread overview: (only message) (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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox