Skip to content

Commit 1867e29

Browse files
committed
perf annotate: Return errors from disasm_line__parse_powerpc()
JIRA: https://issues.redhat.com/browse/RHEL-78197 upstream ======== commit 4c3f09e Author: Athira Rajeev <atrajeev@linux.ibm.com> Date: Tue Mar 4 21:11:14 2025 +0530 description =========== 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> Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 23322f8 commit 1867e29

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/perf/util/disasm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
976976
char *tmp_raw_insn, *name_raw_insn = skip_spaces(line);
977977
char *name = skip_spaces(name_raw_insn + RAW_BYTES);
978978
int disasm = 0;
979+
int ret = 0;
979980

980981
if (args->options->disassembler_used)
981982
disasm = 1;
@@ -984,7 +985,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
984985
return -1;
985986

986987
if (disasm)
987-
disasm_line__parse(name, namep, rawp);
988+
ret = disasm_line__parse(name, namep, rawp);
988989
else
989990
*namep = "";
990991

@@ -998,7 +999,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
998999
if (disasm)
9991000
dl->raw.raw_insn = be32_to_cpu(dl->raw.raw_insn);
10001001

1001-
return 0;
1002+
return ret;
10021003
}
10031004

10041005
static void annotation_line__init(struct annotation_line *al,

0 commit comments

Comments
 (0)