lkml.org 
[lkml]   [2019]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 64/73] libperf: Call perf_evlist__munmap/close on perf_evlist__delete
Date
Let perf_evlist__delete do all the necessary cleanup.

All the cleanup functions check if the their data is
created before cleaning it up, so it's ok to call any
of them separately before perf_evlist__delete.

Link: http://lkml.kernel.org/n/tip-9l1dsswu6rkejfbjg9zm4dld@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/lib/evlist.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c
index 1c8a9e283adc..8920833afa9e 100644
--- a/tools/perf/lib/evlist.c
+++ b/tools/perf/lib/evlist.c
@@ -132,6 +132,11 @@ void perf_evlist__exit(struct perf_evlist *evlist)

void perf_evlist__delete(struct perf_evlist *evlist)
{
+ if (evlist == NULL)
+ return;
+
+ perf_evlist__munmap(evlist);
+ perf_evlist__close(evlist);
perf_evlist__purge(evlist);
perf_evlist__exit(evlist);
free(evlist);
--
2.21.0
\
 
 \ /
  Last update: 2019-09-13 15:28    [W:0.268 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site