From: Zhixing Chen <running910@gmail.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Zhixing Chen <running910@gmail.com>
Subject: [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown()
Date: Thu, 3 Sep 2026 18:43:58 +0800 [thread overview]
Message-ID: <20260903104358.29228-1-running910@gmail.com> (raw)
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
next reply other threads:[~2026-09-03 10:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 10:43 Zhixing Chen [this message]
2026-09-09 4:44 ` [PATCH bpf-next] bpf: Use kvfree() in xdp_test_run_teardown() Emil Tsalapatis
2026-09-12 19:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260903104358.29228-1-running910@gmail.com \
--to=running910@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.