Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Fix btf leak on new btf alloc failure in btf_distill test

Fix btf leak on new btf alloc failure in btf_distill test.

Fixes: affdeb50616b ("selftests/bpf: Extend distilled BTF tests to cover BTF relocation")
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250115100241.4171581-1-pulehui@huaweicloud.com

authored by

Pu Lehui and committed by
Andrii Nakryiko
4a04cb32 7c311b7c

+2 -2
+2 -2
tools/testing/selftests/bpf/prog_tests/btf_distill.c
··· 385 385 "[2] INT 'int' size=8 bits_offset=0 nr_bits=64 encoding=SIGNED"); 386 386 btf5 = btf__new_empty(); 387 387 if (!ASSERT_OK_PTR(btf5, "empty_reloc_btf")) 388 - return; 388 + goto cleanup; 389 389 btf__add_int(btf5, "int", 4, BTF_INT_SIGNED); /* [1] int */ 390 390 VALIDATE_RAW_BTF( 391 391 btf5, ··· 478 478 "[1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED"); 479 479 btf5 = btf__new_empty(); 480 480 if (!ASSERT_OK_PTR(btf5, "empty_reloc_btf")) 481 - return; 481 + goto cleanup; 482 482 btf__add_int(btf5, "int", 4, BTF_INT_SIGNED); /* [1] int */ 483 483 btf__add_int(btf5, "int", 4, BTF_INT_SIGNED); /* [2] int */ 484 484 VALIDATE_RAW_BTF(