public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: Kui-Feng Lee <kuifeng@fb.com>,
	bpf@vger.kernel.org, Martin KaFai Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>
Subject: [PATCH bpf-next] selftests/bpf: Add missing bpf_iter_vma_offset__destroy call
Date: Sun,  2 Oct 2022 17:11:41 +0200	[thread overview]
Message-ID: <20221002151141.1074196-1-jolsa@kernel.org> (raw)

Adding missing bpf_iter_vma_offset__destroy call to
test_task_vma_offset_common function and related goto jumps.

Fixes: b3e1331eb925 ("selftests/bpf: Test parameterized task BPF iterators.")
Cc: Kui-Feng Lee <kuifeng@fb.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
index 3369c5ec3a17..462fe92e0736 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
@@ -1515,11 +1515,11 @@ static void test_task_vma_offset_common(struct bpf_iter_attach_opts *opts, bool
 
 	link = bpf_program__attach_iter(skel->progs.get_vma_offset, opts);
 	if (!ASSERT_OK_PTR(link, "attach_iter"))
-		return;
+		goto exit_skel;
 
 	iter_fd = bpf_iter_create(bpf_link__fd(link));
 	if (!ASSERT_GT(iter_fd, 0, "create_iter"))
-		goto exit;
+		goto exit_link;
 
 	while ((len = read(iter_fd, buf, sizeof(buf))) > 0)
 		;
@@ -1534,8 +1534,10 @@ static void test_task_vma_offset_common(struct bpf_iter_attach_opts *opts, bool
 
 	close(iter_fd);
 
-exit:
+exit_link:
 	bpf_link__destroy(link);
+exit_skel:
+	bpf_iter_vma_offset__destroy(skel);
 }
 
 static void test_task_vma_offset(void)
-- 
2.37.3


             reply	other threads:[~2022-10-02 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 15:11 Jiri Olsa [this message]
2022-10-04  0:12 ` [PATCH bpf-next] selftests/bpf: Add missing bpf_iter_vma_offset__destroy call Martin KaFai Lau
2022-10-04  6:38   ` Jiri Olsa
2022-10-04 12:16     ` Jiri Olsa
2022-10-05 22:58       ` Andrii Nakryiko
2022-10-06  7:03         ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221002151141.1074196-1-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=kuifeng@fb.com \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox