From: Andrii Nakryiko Date: Wed, 2 Feb 2022 22:59:13 +0000 (-0800) Subject: bpftool: Fix uninit variable compilation warning X-Git-Tag: v6.1-rc5~1746^2~392^2~28^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9a8ac592e47ff35363308ad4c66740724132aa3;p=platform%2Fkernel%2Flinux-starfive.git bpftool: Fix uninit variable compilation warning Newer GCC complains about capturing the address of unitialized variable. While there is nothing wrong with the code (the variable is filled out by the kernel), initialize the variable anyway to make compiler happy. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220202225916.3313522-4-andrii@kernel.org --- diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index 111dff8..606743c 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -310,7 +310,7 @@ void get_prog_full_name(const struct bpf_prog_info *prog_info, int prog_fd, { const char *prog_name = prog_info->name; const struct btf_type *func_type; - const struct bpf_func_info finfo; + const struct bpf_func_info finfo = {}; struct bpf_prog_info info = {}; __u32 info_len = sizeof(info); struct btf *prog_btf = NULL;