]> git.ipfire.org Git - thirdparty/linux.git/commit
cpufreq: conservative: Replace sscanf() with kstrtouint()
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>
Sat, 6 Sep 2025 11:53:16 +0000 (17:23 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 10 Sep 2025 10:20:10 +0000 (12:20 +0200)
commit5590db443a40a35d7fba2db12701346be621a19e
tree91fe0a3b0aa81d24eb16d836daa65a9ccb0a04c3
parentae1bdd23b99f64335c69d546bff99ca39b894c18
cpufreq: conservative: Replace sscanf() with kstrtouint()

Replace sscanf() with kstrtouint() in all sysfs store functions to improve
input validation and security. The kstrtouint() function provides better
error detection, overflow protection, and consistent error handling
compared to sscanf().

This maintains existing functionality while improving input validation
robustness and following kernel coding best practices for string parsing.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/20250906115316.3010384-1-kaushlendra.kumar@intel.com
[ rjw: Dropped duplicate paragraph from the changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_conservative.c