Skip to content

Commit db351f3

Browse files
author
Jakub Brnak
committed
perf annotate: Return errors from disasm_line__parse_powerpc()
JIRA: https://issues.redhat.com/browse/RHEL-83785 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: Jakub Brnak <jbrnak@redhat.com>
1 parent b0df8b7 commit db351f3

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
@@ -975,6 +975,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
975975
char *tmp_raw_insn, *name_raw_insn = skip_spaces(line);
976976
char *name = skip_spaces(name_raw_insn + RAW_BYTES);
977977
int disasm = 0;
978+
int ret = 0;
978979

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

985986
if (disasm)
986-
disasm_line__parse(name, namep, rawp);
987+
ret = disasm_line__parse(name, namep, rawp);
987988
else
988989
*namep = "";
989990

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

1000-
return 0;
1001+
return ret;
10011002
}
10021003

10031004
static void annotation_line__init(struct annotation_line *al,

0 commit comments

Comments
 (0)