提交 a9a8ac59 编写于 作者: A Andrii Nakryiko 提交者: Daniel Borkmann

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: NAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: NQuentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220202225916.3313522-4-andrii@kernel.org
上级 1a56c18e
...@@ -310,7 +310,7 @@ void get_prog_full_name(const struct bpf_prog_info *prog_info, int prog_fd, ...@@ -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 char *prog_name = prog_info->name;
const struct btf_type *func_type; const struct btf_type *func_type;
const struct bpf_func_info finfo; const struct bpf_func_info finfo = {};
struct bpf_prog_info info = {}; struct bpf_prog_info info = {};
__u32 info_len = sizeof(info); __u32 info_len = sizeof(info);
struct btf *prog_btf = NULL; struct btf *prog_btf = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册