linux/tools/testing/selftests/bpf/benchs
Malaya Kumar Rout be2fea9c07 selftests/bpf: Close the file descriptor to avoid resource leaks
Static analysis found an issue in bench_htab_mem.c and sk_assign.c

cppcheck output before this patch:
tools/testing/selftests/bpf/benchs/bench_htab_mem.c:284:3: error: Resource leak: fd [resourceLeak]
tools/testing/selftests/bpf/prog_tests/sk_assign.c:41:3: error: Resource leak: tc [resourceLeak]

cppcheck output after this patch:
No resource leaks found

Fix the issue by closing the file descriptors fd and tc.

Signed-off-by: Malaya Kumar Rout <malayarout91@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250421174405.26080-1-malayarout91@gmail.com
2025-04-22 14:29:58 -07:00
..
bench_bloom_filter_map.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_bpf_crypto.c selftests: bpf: crypto: add benchmark for crypto functions 2024-04-24 16:01:10 -07:00
bench_bpf_hashmap_full_update.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_bpf_hashmap_lookup.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_bpf_loop.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_count.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_htab_mem.c selftests/bpf: Close the file descriptor to avoid resource leaks 2025-04-22 14:29:58 -07:00
bench_local_storage_create.c selftests/bpf: Remove second semicolon 2024-03-15 14:53:56 +01:00
bench_local_storage_rcu_tasks_trace.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_local_storage.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_rename.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_ringbufs.c selftests/bpf: Correct two typos 2023-07-07 19:36:04 +02:00
bench_sockmap.c selftest/bpf/benchs: Remove duplicate sys/types.h header 2025-04-15 11:03:57 -07:00
bench_strncmp.c selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
bench_trigger.c selftests/bpf: Clean up open-coded gettid syscall invocations 2024-11-04 11:37:36 -08:00
run_bench_bloom_filter_map.sh bpf/benchs: Add benchmarks for comparing hashmap lookups w/ vs. w/out bloom filter 2021-10-28 13:22:49 -07:00
run_bench_bpf_hashmap_full_update.sh selftest/bpf/benchs: Fix a typo in bpf_hashmap_full_update 2023-02-15 16:29:31 -08:00
run_bench_bpf_loop.sh selftest/bpf/benchs: Add bpf_loop benchmark 2021-11-30 10:56:28 -08:00
run_bench_htab_mem.sh selftests/bpf: Add benchmark for bpf memory allocator 2023-07-05 18:36:19 -07:00
run_bench_local_storage_rcu_tasks_trace.sh selftest/bpf/benchs: Make quiet option common 2023-02-15 16:29:31 -08:00
run_bench_local_storage.sh selftests/bpf: Add benchmark for local_storage get 2022-06-22 19:14:33 -07:00
run_bench_rename.sh selftests/bpf: Clean up fmod_ret in bench_rename test script 2023-08-14 18:43:04 +02:00
run_bench_ringbufs.sh selftests/bpf: Set the default value of consumer_cnt as 0 2023-06-19 13:26:43 -07:00
run_bench_strncmp.sh selftests/bpf: Add benchmark for bpf_strncmp() helper 2021-12-11 17:40:23 -08:00
run_bench_trigger.sh selftests/bpf: add batched tp/raw_tp/fmodret tests 2024-03-28 18:31:40 -07:00
run_bench_uprobes.sh selftests/bpf: remove syscall-driven benchs, keep syscall-count only 2024-03-28 18:31:40 -07:00
run_common.sh selftests/bpf: Add benchmark for local_storage get 2022-06-22 19:14:33 -07:00