mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
tools/libbpf: Avoid possibly using uninitialized variable
Fixes a GCC maybe-uninitialized warning introduced by48cca7e44f
. "text" is only initialized inside the if statement so only print debug info there. Fixes:48cca7e44f
("libbpf: add support for bpf_call") Signed-off-by: Jeremy Cline <jeremy@jcline.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
9c2d63b843
commit
b1a2ce8257
1 changed files with 3 additions and 2 deletions
|
@ -1060,11 +1060,12 @@ bpf_program__reloc_text(struct bpf_program *prog, struct bpf_object *obj,
|
||||||
prog->insns = new_insn;
|
prog->insns = new_insn;
|
||||||
prog->main_prog_cnt = prog->insns_cnt;
|
prog->main_prog_cnt = prog->insns_cnt;
|
||||||
prog->insns_cnt = new_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 = &prog->insns[relo->insn_idx];
|
||||||
insn->imm += prog->main_prog_cnt - 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue