Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <atrajeev@linux.ibm.com>
Tested-By: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Link: https://lore.kernel.org/r/20250304154114.62093-2-atrajeev@linux.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Athira Rajeev and committed by
Namhyung Kim
4c3f09e3 dab8c32e

+3 -2
+3 -2
tools/perf/util/disasm.c
··· 976 976 char *tmp_raw_insn, *name_raw_insn = skip_spaces(line); 977 977 char *name = skip_spaces(name_raw_insn + RAW_BYTES); 978 978 int disasm = 0; 979 + int ret = 0; 979 980 980 981 if (args->options->disassembler_used) 981 982 disasm = 1; ··· 985 984 return -1; 986 985 987 986 if (disasm) 988 - disasm_line__parse(name, namep, rawp); 987 + ret = disasm_line__parse(name, namep, rawp); 989 988 else 990 989 *namep = ""; 991 990 ··· 999 998 if (disasm) 1000 999 dl->raw.raw_insn = be32_to_cpu(dl->raw.raw_insn); 1001 1000 1002 - return 0; 1001 + return ret; 1003 1002 } 1004 1003 1005 1004 static void annotation_line__init(struct annotation_line *al,