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 <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiapeng Chong <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tiezhu Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ebec62b commit 19f4422

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)