Commit 1d98cdf7 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf unwind: Fix uninitialized variable

The 'ret' variable may be uninitialized on error goto paths.

Fixes: dc2cf4ca ("perf unwind: Fix segbase for ld.lld linked objects")
Reported-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: default avatarFangrui Song <maskray@google.com>
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
Cc: Fangrui Song <maskray@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: llvm@lists.linux.dev
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Ullrich <sebasti@nullri.ch>
Link: https://lore.kernel.org/r/20220607000851.39798-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 354c6e07
......@@ -174,7 +174,7 @@ static int elf_section_address_and_offset(int fd, const char *name, u64 *address
Elf *elf;
GElf_Ehdr ehdr;
GElf_Shdr shdr;
int ret;
int ret = -1;
elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
if (elf == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment