diff options
author | Alexey Budankov <[email protected]> | 2018-12-05 20:19:41 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-12-17 14:59:34 -0300 |
commit | c8dd6ee51a4d0a119c8b4121d83008215e3209ed (patch) | |
tree | 1bbecbc4c94dcc66889bc0098c0b8d6033f98b25 | |
parent | 91b2b97025097ce7ca7536bc87eba2bf14760fb4 (diff) |
perf record: Fix memory leak on AIO objects deallocation
Sending a part which was missed between v12 and v13 of the patch set
introducing AIO trace streaming for perf record mode.
The part is essential to avoid memory leakage during deallocation of AIO
related trace data buffers.
Signed-off-by: Alexey Budankov <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ No need to test for NULL before calling zfree() ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/mmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index ab30555d2afc..8fc39311a30d 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -207,8 +207,14 @@ static int perf_mmap__aio_mmap(struct perf_mmap *map, struct mmap_params *mp) static void perf_mmap__aio_munmap(struct perf_mmap *map) { + int i; + + for (i = 0; i < map->aio.nr_cblocks; ++i) + zfree(&map->aio.data[i]); if (map->aio.data) zfree(&map->aio.data); + zfree(&map->aio.cblocks); + zfree(&map->aio.aiocb); } int perf_mmap__aio_push(struct perf_mmap *md, void *to, int idx, |