mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
perf data: Close all files in close_dir()
[ Upstream commit d4b3eedce151e63932ce4a00f1d0baa340a8b907 ]
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: 1455206311 ("perf data: Add perf_data__(create_dir|close_dir) functions")
Signed-off-by: Riccardo Mancini <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Zhen Lei <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
0f63857d10
commit
52cff6123a
1 changed files with 1 additions and 1 deletions
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
static void close_dir(struct perf_data_file *files, int nr)
|
||||
{
|
||||
while (--nr >= 1) {
|
||||
while (--nr >= 0) {
|
||||
close(files[nr].fd);
|
||||
zfree(&files[nr].path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue