diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-09-25 14:30:38 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-09-25 16:15:02 -0400 |
commit | aef70a1f44c0b570e6345c02c2d240471859f0a4 (patch) | |
tree | 30221a00cbb30caeb52a16c339e9f3bbb1d445b1 | |
parent | fcd30ae0665c778e283f73c1c885c7fd26d12ef2 (diff) |
libbpf: fix false uninitialized variable warning
Some compilers emit warning for potential uninitialized next_id usage.
The code is correct, but control flow is too complicated for some
compilers to figure this out. Re-initialize next_id to satisfy
compiler.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r-- | tools/lib/bpf/btf_dump.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c index 715967762312..84b0661db7f3 100644 --- a/tools/lib/bpf/btf_dump.c +++ b/tools/lib/bpf/btf_dump.c | |||
@@ -1167,6 +1167,7 @@ static void btf_dump_emit_type_chain(struct btf_dump *d, | |||
1167 | return; | 1167 | return; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | next_id = decls->ids[decls->cnt - 1]; | ||
1170 | next_t = btf__type_by_id(d->btf, next_id); | 1171 | next_t = btf__type_by_id(d->btf, next_id); |
1171 | multidim = btf_is_array(next_t); | 1172 | multidim = btf_is_array(next_t); |
1172 | /* we need space if we have named non-pointer */ | 1173 | /* we need space if we have named non-pointer */ |