Skip to content

Commit 4c3f09e

Browse files
Athira Rajeevnamhyung
Athira Rajeev
authored andcommitted
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 <[email protected]> Tested-By: Venkat Rao Bagalkote <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent dab8c32 commit 4c3f09e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/perf/util/disasm.c

+3-2
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)