[PATCH bpf-next] selftests/bpf: Fix double free of name

Feng Yang posted 1 patch 3 days, 14 hours ago
tools/testing/selftests/bpf/test_progs.c | 1 -
1 file changed, 1 deletion(-)
[PATCH bpf-next] selftests/bpf: Fix double free of name
Posted by Feng Yang 3 days, 14 hours ago
From: Feng Yang <yangfeng@kylinos.cn>

The name has already been freed in the free_subtest_state function
and does not need to be freed again.

Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
---
 tools/testing/selftests/bpf/test_progs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 7ba82974ee78..1d3caf996971 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -1886,7 +1886,6 @@ static int worker_main_send_subtests(int sock, struct test_state *state)
 			worker_main_send_log(sock, subtest_state->log_buf, subtest_state->log_cnt);
 
 		free_subtest_state(subtest_state);
-		free(subtest_state->name);
 	}
 
 out:
-- 
2.43.0
Re: [PATCH bpf-next] selftests/bpf: Fix double free of name
Posted by bot+bpf-ci@kernel.org 3 days, 13 hours ago
> selftests/bpf: Fix double free of name
>
> The name has already been freed in the free_subtest_state function
> and does not need to be freed again.
>
> Signed-off-by: Feng Yang <yangfeng@kylinos.cn>

The redundant free() looks like it was introduced together with
free_subtest_state() in the same commit. Should this include a Fixes: tag?

  Fixes: 0925225956bb ("bpf/selftests: Add granular subtest output for prog_test")


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/29821735776