Skip to content

Commit 1d98cdf

Browse files
captain5050acmel
authored andcommitted
perf unwind: Fix uninitialized variable
The 'ret' variable may be uninitialized on error goto paths. Fixes: dc2cf4c ("perf unwind: Fix segbase for ld.lld linked objects") Reported-by: Sedat Dilek <sedat.dilek@gmail.com> Reviewed-by: Fangrui Song <maskray@google.com> Signed-off-by: Ian 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.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 354c6e0 commit 1d98cdf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/util/unwind-libunwind-local.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int elf_section_address_and_offset(int fd, const char *name, u64 *address
174174
Elf *elf;
175175
GElf_Ehdr ehdr;
176176
GElf_Shdr shdr;
177-
int ret;
177+
int ret = -1;
178178

179179
elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
180180
if (elf == NULL)

0 commit comments

Comments
 (0)