diff options
| author | Jesper Dangaard Brouer <[email protected]> | 2023-06-06 11:30:47 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-06-06 15:08:22 +0000 |
| commit | 095641817e1bf6aa2560e025e47575188ee3edaf (patch) | |
| tree | 15286ef57c83c8bf494f1fb949a4d9f64ea55d6c /tools/testing/selftests/bpf/prog_tests/check_mtu.c | |
| parent | bpf: Cleanup unused function declaration (diff) | |
| download | kernel-095641817e1bf6aa2560e025e47575188ee3edaf.tar.gz kernel-095641817e1bf6aa2560e025e47575188ee3edaf.zip | |
selftests/bpf: Fix check_mtu using wrong variable type
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: b62eba563229 ("selftests/bpf: Tests using bpf_check_mtu BPF-helper")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/bpf/168605104733.3636467.17945947801753092590.stgit@firesoul
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/check_mtu.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/check_mtu.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ 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(); |
