From 4c3f09e35ca999f69b623d94bf185fe090878296 Mon Sep 17 00:00:00 2001 From: Athira Rajeev Date: Tue, 4 Mar 2025 21:11:14 +0530 Subject: [PATCH] perf annotate: Return errors from disasm_line__parse_powerpc() In disasm_line__parse_powerpc() , return code from function disasm_line__parse() is ignored. This will result in bad results if the disasm_line__parse() fails to disasm the line. Use the return code to fix this. Signed-off-by: Athira Rajeev Tested-By: Venkat Rao Bagalkote Link: https://lore.kernel.org/r/20250304154114.62093-2-atrajeev@linux.ibm.com Signed-off-by: Namhyung Kim --- tools/perf/util/disasm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index a53e8c4e5bca..8f0eb56c6fc6 100644 --- a/tools/perf/util/disasm.c +++ b/tools/perf/util/disasm.c @@ -976,6 +976,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar char *tmp_raw_insn, *name_raw_insn = skip_spaces(line); char *name = skip_spaces(name_raw_insn + RAW_BYTES); int disasm = 0; + int ret = 0; if (args->options->disassembler_used) disasm = 1; @@ -984,7 +985,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar return -1; if (disasm) - disasm_line__parse(name, namep, rawp); + ret = disasm_line__parse(name, namep, rawp); else *namep = ""; @@ -998,7 +999,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar if (disasm) dl->raw.raw_insn = be32_to_cpu(dl->raw.raw_insn); - return 0; + return ret; } static void annotation_line__init(struct annotation_line *al,