OpenCloudOS-Kernel/tools/power/cpupower/lib
Hao Zeng e652be0f59 cpupower:Fix resource leaks in sysfs_get_enabled()
The sysfs_get_enabled() opened file processor not closed,
may cause a file handle leak.
Putting error handling and resource cleanup code together
makes the code easy to maintain and read.
Removed the unnecessary else if branch from the original
function, as it should return an error in cases other than '0'.

Signed-off-by: Hao Zeng <zenghao@kylinos.cn>
Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-05-08 08:11:24 -06:00
..
acpi_cppc.c cpupower: Introduce ACPI CPPC library 2022-02-22 18:36:50 -07:00
acpi_cppc.h cpupower: Introduce ACPI CPPC library 2022-02-22 18:36:50 -07:00
cpufreq.c cpupower: Add the function to get the sysfs value from specific table 2022-02-22 18:36:44 -07:00
cpufreq.h cpupower: Add the function to get the sysfs value from specific table 2022-02-22 18:36:44 -07:00
cpuidle.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
cpuidle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpupower.c tools/power/cpupower: Read energy_perf_bias from sysfs 2020-11-16 17:42:12 +01:00
cpupower.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpupower_intern.h tools/power/cpupower: Read energy_perf_bias from sysfs 2020-11-16 17:42:12 +01:00
powercap.c cpupower:Fix resource leaks in sysfs_get_enabled() 2023-05-08 08:11:24 -06:00
powercap.h cpupower: Introduce powercap intel-rapl library and powercap-info command 2022-11-30 16:48:28 -07:00