lkml.org 
[lkml]   [2021]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf machine: Free machine__findnew_dso
Date
ASan reports memory leaks while running:

$ rm perf.data*
$ perf report

This patch adds the missing dso__put.

Fixes: 8c7f1bb37b29 ("perf machine: Move kernel mmap name into struct
machine")

Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
---
tools/perf/util/machine.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index fb8496df8432..826be7a12da1 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1742,6 +1742,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
*/
dso__load(kernel, machine__kernel_map(machine));
}
+
+ dso__put(kernel);
} else if (perf_event__is_extra_kernel_mmap(machine, xm)) {
return machine__process_extra_kernel_map(machine, xm);
}
--
2.25.1
\
 
 \ /
  Last update: 2021-11-19 05:27    [W:0.049 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site