From: Alan Maguire <alan.maguire@oracle.com>
To: Geliang Tang <geliang@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Mykola Lysenko <mykolal@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>
Cc: Geliang Tang <tanggeliang@kylinos.cn>,
bpf@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next 3/3] selftests/bpf: Close obj in error paths in xdp_adjust_tail
Date: Wed, 10 Jul 2024 15:54:05 +0100 [thread overview]
Message-ID: <652ba92e-8f74-47e8-a8c6-76e147421830@oracle.com> (raw)
In-Reply-To: <3e55e7dc99f0331566cc3bb140fc189a0f8943e9.1720521482.git.tanggeliang@kylinos.cn>
On 09/07/2024 11:45, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj"
> opened before this should be closed. So use "goto out" to close it instead
> of using "return" here.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
...with one suggestion below...
> ---
> tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c
> index f09505f8b038..53d6ad8c2257 100644
> --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c
> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c
> @@ -222,7 +222,7 @@ static void test_xdp_adjust_frags_tail_grow(void)
>
> prog = bpf_object__next_program(obj, NULL);
> if (bpf_object__load(obj))
> - return;
> + goto out;
>
Nit: perhaps we should change this to
if (!ASSERT_OK(bpf_object__load(obj), "obj_load"))
goto out;
?
prev parent reply other threads:[~2024-07-10 14:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 10:45 [PATCH bpf-next 0/3] BPF selftests misc fixes Geliang Tang
2024-07-09 10:45 ` [PATCH bpf-next 1/3] selftests/bpf: Null checks for links in bpf_tcp_ca Geliang Tang
2024-07-10 11:25 ` Alan Maguire
2024-07-10 13:07 ` Geliang Tang
2024-07-09 10:45 ` [PATCH bpf-next 2/3] selftests/bpf: Check ASSERT_OK(err) in dummy_st_ops Geliang Tang
2024-07-10 14:01 ` Alan Maguire
2024-07-09 10:45 ` [PATCH bpf-next 3/3] selftests/bpf: Close obj in error paths in xdp_adjust_tail Geliang Tang
2024-07-10 14:54 ` Alan Maguire [this message]
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=652ba92e-8f74-47e8-a8c6-76e147421830@oracle.com \
--to=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=geliang@kernel.org \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tanggeliang@kylinos.cn \
--cc=yonghong.song@linux.dev \
/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