Skip to content

Commit

Permalink
libbpf: Fix false uninitialized variable warning
Browse files Browse the repository at this point in the history
Some versions of GCC falsely detect that vi might not be initialized. That's
not true, but let's silence it with NULL initialization.

Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
anakryiko authored and borkmann committed Apr 30, 2020
1 parent 91f6585 commit 063e688
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lib/bpf/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5003,8 +5003,8 @@ static int bpf_object__collect_map_relos(struct bpf_object *obj,
GElf_Shdr *shdr, Elf_Data *data)
{
int i, j, nrels, new_sz, ptr_sz = sizeof(void *);
const struct btf_var_secinfo *vi = NULL;
const struct btf_type *sec, *var, *def;
const struct btf_var_secinfo *vi;
const struct btf_member *member;
struct bpf_map *map, *targ_map;
const char *name, *mname;
Expand Down

0 comments on commit 063e688

Please sign in to comment.