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: 2119f2189d ("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>
This commit is contained in:
Andrii Nakryiko
2021-03-13 13:09:18 -08:00
committed by Greg Kroah-Hartman
parent b1ed7a5717
commit 3d15bf2b2c
3 changed files with 5 additions and 3 deletions

View File

@@ -99,7 +99,7 @@ static int do_dump_btf(const struct btf_dumper *d,
void *value)
{
__u32 value_id;
int ret;
int ret = 0;
/* start of key-value pair */
jsonw_start_object(d->jw);