bpf: Use kvfree() in xdp_test_run_teardown()
Subsystems (2)
PATCH 1/1 bpf: Use kvfree() in xdp_test_run_teardown()
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.
--- net/bpf/test_run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bpf/test_run.c +2 -2
@@ -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
Signature · 1 line
2.34.1
Quoted 10 lines · Zhixing Chen
xdp_test_run_setup()allocatesxdp->framesandxdp->skbswithkvmalloc_array(). The setup error path already releases both arrays withkvfree(), while the normal teardown path still useskfree().Use
kvfree()inxdp_test_run_teardown()as well, so the release helper matches the allocator on both paths.Signed-off-by Zhixing Chen <[email protected]>---
Quoted 24 lines
net/bpf/test_run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/bpf/test_run.c +2
-2@@ -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
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Thu, 3 Sep 2026 18:43:58 +0800 you wrote:
xdp_test_run_setup()allocatesxdp->framesandxdp->skbswithkvmalloc_array(). The setup error path already releases both arrays withkvfree(), while the normal teardown path still useskfree().Use
kvfree()inxdp_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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html