diff options
| author | Malaya Kumar Rout <[email protected]> | 2025-04-21 17:44:05 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2025-04-22 21:29:58 +0000 |
| commit | be2fea9c07d40a0a897580166e3d43c53ef3b75b (patch) | |
| tree | d5303c09958bff7fa3f58e8696c4b4392913e295 /tools/lib/bpf | |
| parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after rc3 (diff) | |
| download | kernel-be2fea9c07d40a0a897580166e3d43c53ef3b75b.tar.gz kernel-be2fea9c07d40a0a897580166e3d43c53ef3b75b.zip | |
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 <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf')
0 files changed, 0 insertions, 0 deletions
