Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

libbpf: Fix uninitialized variable in btf_parse_type_sec

Fix obvious unitialized variable use that wasn't reported by compiler. libbpf
Makefile changes to catch such errors are added separately.

Fixes: 3289959b97ca ("libbpf: Support BTF loading and raw data output in both endianness")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200929220604.833631-1-andriin@fb.com

authored by

Andrii Nakryiko and committed by
Alexei Starovoitov
33433913 67e4ca74

+1 -1
+1 -1
tools/lib/bpf/btf.c
··· 347 347 struct btf_header *hdr = btf->hdr; 348 348 void *next_type = btf->types_data; 349 349 void *end_type = next_type + hdr->type_len; 350 - int err, i, type_size; 350 + int err, i = 0, type_size; 351 351 352 352 /* VOID (type_id == 0) is specially handled by btf__get_type_by_id(), 353 353 * so ensure we can never properly use its offset from index by