]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix bpf_object leak in skb_ctx selftest
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 7 Nov 2021 16:55:21 +0000 (08:55 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 7 Nov 2021 17:14:15 +0000 (09:14 -0800)
commitc7d1c2d3cee0d13c57aeefa04d35e1af1941e9cc
tree962f7846ac07f097a97c482b2ba6597835f235d5
parentb41156d57fafbc06b04bef84e6d4cc98ebdb93b4
selftests/bpf: Fix bpf_object leak in skb_ctx selftest

skb_ctx selftest didn't close bpf_object implicitly allocated by
bpf_prog_test_load() helper. Fix the problem by explicitly calling
bpf_object__close() at the end of the test.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-10-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/skb_ctx.c