]> git.baikalelectronics.ru Git - kernel.git/commit
perf data: Close all files in close_dir()
authorRiccardo Mancini <rickyman7@gmail.com>
Fri, 16 Jul 2021 14:11:20 +0000 (16:11 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 18 Jul 2021 12:27:49 +0000 (09:27 -0300)
commitfe311fc09ada2363956f067b13cc1ec3f67b0890
tree0a66df57e82b5b1ac69c37423447c623e31dcbff
parent83613c6b25b626ffd6db07c89a5d6d45a0a967d1
perf data: Close all files in close_dir()

When using 'perf report' in directory mode, the first file is not closed
on exit, causing a memory leak.

The problem is caused by the iterating variable never reaching 0.

Fixes: faa8beb870fdcda9 ("perf data: Add perf_data__(create_dir|close_dir) functions")
Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Link: http://lore.kernel.org/lkml/20210716141122.858082-1-rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/data.c