diff options
| author | Kaushlendra Kumar <kaushlendra.kumar@intel.com> | 2025-09-25 12:08:12 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-22 08:09:25 +0200 |
| commit | b811e8a01d8db2ea605e6158063aac0bf00c77b8 (patch) | |
| tree | 0e12dbf72ea8a77cceb24d8f16a5fbb38878f71a /rust/kernel/ptr.rs | |
| parent | fe6193a3187a1a7482ccfbc904bc527e7730a36c (diff) | |
firmware_loader: Replace simple_strtol() with kstrtoint()
Replace deprecated simple_strtol() calls with kstrtoint() in
timeout_store() and firmware_loading_store() functions to
improve input validation and error handling. The simple_strtol()
function does not provide proper error checking for invalid input,
while kstrtoint() returns an error for malformed strings.
This change adds proper validation for user input from sysfs attributes,
returning -EINVAL for invalid numeric strings instead of silently accepting
potentially malformed input. The behavior for valid numeric input remains
unchanged.
The simple_strtol() function is deprecated in favor of kstrtoint() family
functions which provide better error handling and are recommended for new
code and replacements.
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Link: https://patch.msgid.link/20250925063812.2269501-1-kaushlendra.kumar@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/kernel/ptr.rs')
0 files changed, 0 insertions, 0 deletions
