diff options
| author | Andrii Nakryiko <[email protected]> | 2021-11-07 16:55:21 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2021-11-07 17:14:15 +0000 |
| commit | 8c7a95520184b6677ca6075e12df9c208d57d088 (patch) | |
| tree | 962f7846ac07f097a97c482b2ba6597835f235d5 | |
| parent | selftests/bpf: Destroy XDP link correctly (diff) | |
| download | kernel-8c7a95520184b6677ca6075e12df9c208d57d088.tar.gz kernel-8c7a95520184b6677ca6075e12df9c208d57d088.zip | |
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Reviewed-by: Hengqi Chen <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/skb_ctx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/skb_ctx.c b/tools/testing/selftests/bpf/prog_tests/skb_ctx.c index d3106078838c..b5319ba2ee27 100644 --- a/tools/testing/selftests/bpf/prog_tests/skb_ctx.c +++ b/tools/testing/selftests/bpf/prog_tests/skb_ctx.c @@ -111,4 +111,6 @@ void test_skb_ctx(void) "ctx_out_mark", "skb->mark == %u, expected %d\n", skb.mark, 10); + + bpf_object__close(obj); } |
