linux-kernelorg-stable/tools/power/cpupower/lib
Kaushlendra Kumar 23199d2aa6 tools/cpupower: Fix incorrect size in cpuidle_state_disable()
Fix incorrect size parameter passed to cpuidle_state_write_file() in
cpuidle_state_disable().

The function was incorrectly using sizeof(disable) which returns the
size of the unsigned int variable (4 bytes) instead of the actual
length of the string stored in the 'value' buffer.

Since 'value' is populated with snprintf() to contain the string
representation of the disable value, we should use the length
returned by snprintf() to get the correct string length for
writing to the sysfs file.

This ensures the correct number of bytes is written to the cpuidle
state disable file in sysfs.

Link: https://lore.kernel.org/r/20250917050820.1785377-1-kaushlendra.kumar@intel.com
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2025-09-24 17:15:35 -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 support for showing energy performance preference 2024-12-20 09:12:07 -07:00
cpufreq.h cpupower: Add support for showing energy performance preference 2024-12-20 09:12:07 -07:00
cpuidle.c tools/cpupower: Fix incorrect size in cpuidle_state_disable() 2025-09-24 17:15:35 -06:00
cpuidle.h tools/cpupower: display residency value in idle-info 2024-08-09 10:32:33 -06:00
cpupower.c tools/cpupower: fix error return value in cpupower_write_sysfs() 2025-09-16 16:21:50 -06:00
cpupower.h cpupower: Implement CPU physical core querying 2025-03-06 13:27:57 -07:00
cpupower_intern.h cpupower: Add is_valid_path API 2023-07-18 16:06:44 -06:00
powercap.c pm:cpupower: Add missing powercap_set_enabled() stub function 2024-09-05 18:48:57 -06:00
powercap.h cpupower: Introduce powercap intel-rapl library and powercap-info command 2022-11-30 16:48:28 -07:00