summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-11-22 00:19:18 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-18 14:03:32 +0100
commit654841dd211b006803a5f8a4005f03010e0fdbdc (patch)
tree6b75a1a1297d6b33622e965ed5362e93730acfd5 /tools
parentbadf751a785d624f2ab326f7d00d11a5a78842dc (diff)
downloadlinux-654841dd211b006803a5f8a4005f03010e0fdbdc.tar.gz
linux-654841dd211b006803a5f8a4005f03010e0fdbdc.tar.bz2
linux-654841dd211b006803a5f8a4005f03010e0fdbdc.zip
perf hist: In init, ensure mem_info is put on error paths
[ Upstream commit f60efb4454b24cc944ff3eac164bb9dce9169f71 ] Rather than exit the internal map_symbols directly, put the mem-info that does this and also lowers the reference count on the mem-info itself otherwise the mem-info is being leaked. Fixes: 56e144fe98260a0f ("perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit") Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/hist.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 64ff427040c3..ef4b569f7df4 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -608,10 +608,8 @@ err_infos:
map_symbol__exit(&he->branch_info->to.ms);
zfree(&he->branch_info);
}
- if (he->mem_info) {
- map_symbol__exit(&mem_info__iaddr(he->mem_info)->ms);
- map_symbol__exit(&mem_info__daddr(he->mem_info)->ms);
- }
+ if (he->mem_info)
+ mem_info__zput(he->mem_info);
err:
map_symbol__exit(&he->ms);
zfree(&he->stat_acc);