diff options
| author | Li Huafei <lihuafei1@huawei.com> | 2024-10-19 23:41:57 +0800 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2024-10-23 15:36:14 -0700 |
| commit | 150dab31d5609f896fbfaa06b442ca314da79858 (patch) | |
| tree | 69bf086dc7aaf7789073374d0b17e92e621a5721 /tools | |
| parent | perf disasm: Use disasm_line__free() to properly free disasm_line (diff) | |
| download | linux-150dab31d5609f896fbfaa06b442ca314da79858.tar.gz linux-150dab31d5609f896fbfaa06b442ca314da79858.zip | |
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 <lihuafei1@huawei.com>
Tested-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
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 <namhyung@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/util/disasm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index 5fdd5afc5c2f..bd98fec903f7 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; |
