perf machine: Free machine__findnew_dso
PATCH 1/1 perf machine: Free machine__findnew_dso
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 <[email protected]>
--- tools/perf/util/machine.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/machine.c +2 -0
@@ -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); }
Signature · 1 line
2.25.1
Quoted 20 lines · Sohaib Mohamed
ASan reports memory leaks while running:
$ rm perf.data* $ perf reportThis patch adds the missing
dso__put.Fixes 8c7f1bb37b29 ("perf machine: Move kernel mmap name into structmachine")
Signed-off-by Sohaib Mohamed <[email protected]>--- tools/perf/util/machine.c | 2 ++ 1 file changed, 2 insertions(+)tools/perf/util/machine.c +0
-0
tools/perf/util/machine.c static int machine__process_kernel_mmap_event(struct machine *machine, · line 1746
Quoted 5 lines
tools/perf/util/machine.c +2
-0@@ -1742,6 +1742,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine,*/ dso__load (kernel,machine__kernel_map (machine)); } + +dso__put (kernel);
nice catch, after machine__findnew_dso we need to do that
but there's also dso search before we call machine__findnew_dso, that can find dso, so I wonder we need to add change below as well
thanks,
jirka
---
tools/perf/util/machine.c +1 -1
@@ -1700,7 +1700,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,continue ; - kernel = dso; + kernel =dso__get (dso);break ; }