Commit d4b3eedc authored by Riccardo Mancini's avatar Riccardo Mancini Committed by Arnaldo Carvalho de Melo
Browse files

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: 14552063

 ("perf data: Add perf_data__(create_dir|close_dir) functions")
Signed-off-by: default avatarRiccardo Mancini <>
Acked-by: default avatarNamhyung Kim <>
Cc: Alexander Shishkin <>
Cc: Ian Rogers <>
Cc: Jiri Olsa <>
Cc: Mark Rutland <>
Cc: Peter Zijlstra <>
Cc: Zhen Lei <>

Signed-off-by: default avatarArnaldo Carvalho de Melo <>
parent e0fa7ab4
......@@ -20,7 +20,7 @@
static void close_dir(struct perf_data_file *files, int nr)
while (--nr >= 1) {
while (--nr >= 0) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment