aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2022-06-06 17:08:51 -0700
committerArnaldo Carvalho de Melo <[email protected]>2022-06-19 10:41:43 -0300
commit1d98cdf7fa2bc6e8063c0a692a1c091d8ebe3a75 (patch)
treef7df771bc24ed8f366c657cf7114009e67f4715d
parent354c6e071be986a44b956f7b57f1884244431048 (diff)
perf unwind: Fix uninitialized variable
The 'ret' variable may be uninitialized on error goto paths. Fixes: dc2cf4ca866f5715 ("perf unwind: Fix segbase for ld.lld linked objects") Reported-by: Sedat Dilek <[email protected]> Reviewed-by: Fangrui Song <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Tested-by: Sedat Dilek <[email protected]> # LLVM-14 (x86-64) Cc: Fangrui Song <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: [email protected] Cc: Peter Zijlstra <[email protected]> Cc: Sebastian Ullrich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/unwind-libunwind-local.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 37622699c91a..6e5b8cce47bf 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -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)