diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-03-13 13:09:18 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-14 09:50:29 +0200 |
commit | 3d15bf2b2c93dd606da7a3c163a56ef91d802463 (patch) | |
tree | 377028d5aa1efff6e8c1f3eeafd0a7b8d5369e4a /tools/bpf/bpftool/btf.c | |
parent | b1ed7a57175082024eed73259dbd97d7f5d888fc (diff) | |
download | kernel_replicant_linux-3d15bf2b2c93dd606da7a3c163a56ef91d802463.tar.gz kernel_replicant_linux-3d15bf2b2c93dd606da7a3c163a56ef91d802463.tar.bz2 kernel_replicant_linux-3d15bf2b2c93dd606da7a3c163a56ef91d802463.zip |
bpftool: Fix maybe-uninitialized warnings
[ Upstream commit 4bbb3583687051ef99966ddaeb1730441b777d40 ]
Somehow when bpftool is compiled in -Og mode, compiler produces new warnings
about possibly uninitialized variables. Fix all the reported problems.
Fixes: 2119f2189df1 ("bpftool: add C output format option to btf dump subcommand")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210313210920.1959628-3-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/bpf/bpftool/btf.c')
-rw-r--r-- | tools/bpf/bpftool/btf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 2afb7d5b1aca..592803af9734 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -519,6 +519,7 @@ static int do_dump(int argc, char **argv) NEXT_ARG(); if (argc < 1) { p_err("expecting value for 'format' option\n"); + err = -EINVAL; goto done; } if (strcmp(*argv, "c") == 0) { @@ -528,11 +529,13 @@ static int do_dump(int argc, char **argv) } else { p_err("unrecognized format specifier: '%s', possible values: raw, c", *argv); + err = -EINVAL; goto done; } NEXT_ARG(); } else { p_err("unrecognized option: '%s'", *argv); + err = -EINVAL; goto done; } } |