linux-stable/tools
Song Liu 12e70c6f4e selftests/bpf: Fix leaked bpf_link in get_stackid_cannot_attach
[ Upstream commit c1e07a80cf ]

skel->links.oncpu is leaked in one case. This causes test perf_branches
fails when it runs after get_stackid_cannot_attach:

./test_progs -t get_stackid_cannot_attach,perf_branches
84      get_stackid_cannot_attach:OK
test_perf_branches_common:PASS:test_perf_branches_load 0 nsec
test_perf_branches_common:PASS:attach_perf_event 0 nsec
test_perf_branches_common:PASS:set_affinity 0 nsec
check_good_sample:FAIL:output not valid no valid sample from prog
146/1   perf_branches/perf_branches_hw:FAIL
146/2   perf_branches/perf_branches_no_hw:OK
146     perf_branches:FAIL

All error logs:
test_perf_branches_common:PASS:test_perf_branches_load 0 nsec
test_perf_branches_common:PASS:attach_perf_event 0 nsec
test_perf_branches_common:PASS:set_affinity 0 nsec
check_good_sample:FAIL:output not valid no valid sample from prog
146/1   perf_branches/perf_branches_hw:FAIL
146     perf_branches:FAIL
Summary: 1/1 PASSED, 0 SKIPPED, 1 FAILED

Fix this by adding the missing bpf_link__destroy().

Fixes: 346938e938 ("selftests/bpf: Add get_stackid_cannot_attach")
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230412210423.900851-3-song@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:00:28 +09:00
..
accounting
arch tools/x86/kcpuid: Fix avx512bw and avx512lvl fields in Fn00000007 2023-05-11 23:00:20 +09:00
bootconfig bootconfig: Fix testcase to increase max node 2023-03-30 12:47:47 +02:00
bpf bpftool: Fix bug for long instructions in program CFG dumps 2023-05-11 23:00:27 +09:00
build tools build: Add feature test for init_disassemble_info API changes 2023-03-17 08:49:03 +01:00
cgroup
debugging
edid
firewire
firmware
gpio tools: gpio: fix -c option of gpio-event-mon 2023-02-01 08:27:29 +01:00
hv
iio tools/iio/iio_utils:fix memory leak 2023-03-11 13:57:34 +01:00
include tools include: add dis-asm-compat.h to handle version differences 2023-03-17 08:49:04 +01:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:07:51 +02:00
laptop
leds
lib libbpf: Fix single-line struct definition output in btf_dump 2023-04-20 12:13:54 +02:00
memory-model
objtool objtool: Fix memory leak in create_static_call_sections() 2023-03-11 13:57:22 +01:00
pci
pcmcia
perf tools perf: Fix compilation error with new binutils 2023-03-17 08:49:04 +01:00
power tools/power turbostat: fix decoding of HWP_STATUS 2023-04-05 11:24:54 +02:00
rcu
scripts
spi
testing selftests/bpf: Fix leaked bpf_link in get_stackid_cannot_attach 2023-05-11 23:00:28 +09:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-17 14:24:15 +02:00
time
tracing tools/latency-collector: Use correct size when writing queue_full_warning 2021-11-18 19:16:19 +01:00
usb usb: testusb: Fix for showing the connection speed 2021-09-14 10:31:41 +02:00
virtio tools/virtio: fix the vringh test for virtio ring changes 2023-02-22 12:57:01 +01:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-12-08 11:28:42 +01:00
wmi
Makefile