selftests/bpf: Fix check_mtu using wrong variable type
[ Upstream commit095641817e
] 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. Fixes:b62eba5632
("selftests/bpf: Tests using bpf_check_mtu BPF-helper") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/bpf/168605104733.3636467.17945947801753092590.stgit@firesoul Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
da79a0bc36
commit
54257a7634
|
@ -183,7 +183,7 @@ cleanup:
|
|||
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue