From: Li Huafei Date: Sat, 19 Oct 2024 15:41:57 +0000 (+0800) Subject: perf disasm: Fix not cleaning up disasm_line in symbol__disassemble_raw() X-Git-Tag: v6.13-rc1~68^2~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=150dab31d5609f896fbfaa06b442ca314da79858;p=thirdparty%2Flinux.git perf disasm: Fix not cleaning up disasm_line in symbol__disassemble_raw() In symbol__disassemble_raw(), the created disasm_line should be discarded before returning an error. When creating disasm_line fails, break the loop and then release the created lines. Fixes: 0b971e6bf1c3 ("perf annotate: Add support to capture and parse raw instruction in powerpc using dso__data_read_offset utility") Signed-off-by: Li Huafei Tested-by: Athira Rajeev Cc: sesse@google.com Cc: kjain@linux.ibm.com Link: https://lore.kernel.org/r/20241019154157.282038-3-lihuafei1@huawei.com Signed-off-by: Namhyung Kim --- diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index 5fdd5afc5c2fa..bd98fec903f73 100644 --- a/tools/perf/util/disasm.c +++ b/tools/perf/util/disasm.c @@ -1773,7 +1773,7 @@ static int symbol__disassemble_raw(char *filename, struct symbol *sym, sprintf(args->line, "%x", line[i]); dl = disasm_line__new(args); if (dl == NULL) - goto err; + break; annotation_line__add(&dl->al, ¬es->src->source); offset += 4;