提交 b1a2ce82 编写于 作者: J Jeremy Cline 提交者: Daniel Borkmann

tools/libbpf: Avoid possibly using uninitialized variable

Fixes a GCC maybe-uninitialized warning introduced by 48cca7e4.
"text" is only initialized inside the if statement so only print debug
info there.

Fixes: 48cca7e4 ("libbpf: add support for bpf_call")
Signed-off-by: NJeremy Cline <jeremy@jcline.org>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 9c2d63b8
......@@ -1060,11 +1060,12 @@ bpf_program__reloc_text(struct bpf_program *prog, struct bpf_object *obj,
prog->insns = new_insn;
prog->main_prog_cnt = prog->insns_cnt;
prog->insns_cnt = new_cnt;
pr_debug("added %zd insn from %s to prog %s\n",
text->insns_cnt, text->section_name,
prog->section_name);
}
insn = &prog->insns[relo->insn_idx];
insn->imm += prog->main_prog_cnt - relo->insn_idx;
pr_debug("added %zd insn from %s to prog %s\n",
text->insns_cnt, text->section_name, prog->section_name);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册