diff mbox series

[bpf-next,1/3] libbpf: fix uninitialized variable in btf_parse_type_sec

Message ID 20200929220604.833631-1-andriin@fb.com (mailing list archive)
State Accepted
Commit 33433913459a6bfbfa808c202d6f5490aa43d7a7
Headers show
Series [bpf-next,1/3] libbpf: fix uninitialized variable in btf_parse_type_sec | expand

Commit Message

Andrii Nakryiko Sept. 29, 2020, 10:06 p.m. UTC
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>
---
 tools/lib/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin KaFai Lau Sept. 30, 2020, 12:01 a.m. UTC | #1
On Tue, Sep 29, 2020 at 03:06:02PM -0700, Andrii Nakryiko wrote:
> Fix obvious unitialized variable use that wasn't reported by compiler. libbpf
> Makefile changes to catch such errors are added separately.
Acked-by: Martin KaFai Lau <kafai@fb.com>
patchwork-bot+bpf@kernel.org Sept. 30, 2020, 12:10 a.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (refs/heads/master):

On Tue, 29 Sep 2020 15:06:02 -0700 you wrote:
> 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>
> ---
>  tools/lib/bpf/btf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [bpf-next,1/3] libbpf: fix uninitialized variable in btf_parse_type_sec
    https://git.kernel.org/bpf/bpf-next/c/33433913459a
  - [bpf-next,2/3] libbpf: compile libbpf under -O2 level by default and catch extra warnings
    https://git.kernel.org/bpf/bpf-next/c/0a62291d697f
  - [bpf-next,3/3] libbpf: compile in PIC mode only for shared library case
    https://git.kernel.org/bpf/bpf-next/c/b0efc216f577

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index e1dbd766c698..398b1f345b3c 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -347,7 +347,7 @@  static int btf_parse_type_sec(struct btf *btf)
 	struct btf_header *hdr = btf->hdr;
 	void *next_type = btf->types_data;
 	void *end_type = next_type + hdr->type_len;
-	int err, i, type_size;
+	int err, i = 0, type_size;
 
 	/* VOID (type_id == 0) is specially handled by btf__get_type_by_id(),
 	 * so ensure we can never properly use its offset from index by