Skip to content

Commit 19f4422

Browse files
captain5050acmel
authored andcommitted
perf test: Directory file descriptor leak
Add missed close when iterating over the script directories. Fixes: f3295f5 ("perf tests: Use scandirat for shell script finding") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tiezhu Yang <yangtiezhu@loongson.cn> Link: https://lore.kernel.org/r/20250614004108.1650988-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent ebec62b commit 19f4422

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tools/perf/tests/tests-scripts.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ static void append_scripts_in_dir(int dir_fd,
260260
continue; /* Skip scripts that have a separate driver. */
261261
fd = openat(dir_fd, ent->d_name, O_PATH);
262262
append_scripts_in_dir(fd, result, result_sz);
263+
close(fd);
263264
}
264265
for (i = 0; i < n_dirs; i++) /* Clean up */
265266
zfree(&entlist[i]);

0 commit comments

Comments
 (0)