linux/tools/power/x86
Malaya Kumar Rout 71b23ada25 tools/power/x86/intel-speed-select: Fix file descriptor leak in isolate_cpus()
[ Upstream commit 56c17ee151 ]

The file descriptor opened in isolate_cpus() when (!level) is true was
not being closed before returning, causing a file descriptor leak in
both the error path and the success path.

When write() fails at line 950, the function returns at line 953 without
closing the file descriptor. Similarly, on success, the function returns
at line 956 without closing the file descriptor.

Add close(fd) calls before both return statements to fix the resource
leak. This follows the same pattern used elsewhere in the same function
where file descriptors are properly closed before returning (see lines
1005 and 1027).

Fixes: 997074df65 ("tools/power/x86/intel-speed-select: Use cgroup v2 isolation")
Signed-off-by: Malaya Kumar Rout <mrout@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-02-26 14:59:25 -08:00
..
amd_pstate_tracer tools/power/x86/amd_pstate_tracer: Fix python gnuplot package names 2025-09-23 13:42:20 -05:00
intel-speed-select tools/power/x86/intel-speed-select: Fix file descriptor leak in isolate_cpus() 2026-02-26 14:59:25 -08:00
intel_pstate_tracer tools/power/x86/intel_pstate_tracer: python minimum version 2023-09-21 20:35:50 +02:00
turbostat tools/power turbostat: Regression fix Uncore MHz printed in hex 2025-12-18 14:02:36 +01:00
x86_energy_perf_policy tools/power x86_energy_perf_policy.8: Emphasize preference for SW interfaces 2025-09-25 23:12:01 -04:00