From: Jesper Dangaard Brouer <jbrouer@redhat.com>
To: Daniel Borkmann <borkmann@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
bpf@vger.kernel.org
Cc: brouer@redhat.com, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH bpf-next V1] selftests/bpf: Fix check_mtu using wrong variable type
Date: Tue, 6 Jun 2023 13:32:51 +0200 [thread overview]
Message-ID: <fae329d4-2599-d677-2ace-81bc137a758f@redhat.com> (raw)
In-Reply-To: <168605104733.3636467.17945947801753092590.stgit@firesoul>
On 06/06/2023 13.30, Jesper Dangaard Brouer wrote:
> Dan Carpenter found via Smatch static checker, that unsigned
> 'mtu_lo' is never less than zero.
>
> Variable mtu_lo should have been an 'int', because read_mtu_device_lo()
> uses minus as error indications.
>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> ---
> tools/testing/selftests/bpf/prog_tests/check_mtu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Providing the fixes like that I forgot.
Fixes: b62eba563229 ("selftests/bpf: Tests using bpf_check_mtu BPF-helper")
> diff --git a/tools/testing/selftests/bpf/prog_tests/check_mtu.c b/tools/testing/selftests/bpf/prog_tests/check_mtu.c
> index 5338d2ea0460..2a9a30650350 100644
> --- a/tools/testing/selftests/bpf/prog_tests/check_mtu.c
> +++ b/tools/testing/selftests/bpf/prog_tests/check_mtu.c
> @@ -183,7 +183,7 @@ static void test_check_mtu_tc(__u32 mtu, __u32 ifindex)
>
> void serial_test_check_mtu(void)
> {
> - __u32 mtu_lo;
> + int mtu_lo;
>
> if (test__start_subtest("bpf_check_mtu XDP-attach"))
> test_check_mtu_xdp_attach();
>
>
next prev parent reply other threads:[~2023-06-06 11:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 11:30 [PATCH bpf-next V1] selftests/bpf: Fix check_mtu using wrong variable type Jesper Dangaard Brouer
2023-06-06 11:32 ` Jesper Dangaard Brouer [this message]
2023-06-06 15:05 ` Simon Horman
2023-06-06 15:10 ` patchwork-bot+netdevbpf
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=fae329d4-2599-d677-2ace-81bc137a758f@redhat.com \
--to=jbrouer@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=borkmann@iogearbox.net \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).