]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf test: Directory file descriptor leak
authorIan Rogers <irogers@google.com>
Sat, 14 Jun 2025 00:41:04 +0000 (17:41 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 17 Jun 2025 21:29:42 +0000 (18:29 -0300)
Add missed close when iterating over the script directories.

Fixes: f3295f5b067d3c26 ("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>
tools/perf/tests/tests-scripts.c

index 1d5759d08141749d55212edb41097501f0243b40..3a2a8438f9af1bd12d0d232397d88129730c75cf 100644 (file)
@@ -260,6 +260,7 @@ static void append_scripts_in_dir(int dir_fd,
                        continue; /* Skip scripts that have a separate driver. */
                fd = openat(dir_fd, ent->d_name, O_PATH);
                append_scripts_in_dir(fd, result, result_sz);
+               close(fd);
        }
        for (i = 0; i < n_dirs; i++) /* Clean up */
                zfree(&entlist[i]);