diff options
| author | Kaushlendra Kumar <kaushlendra.kumar@intel.com> | 2025-11-03 13:36:27 +0530 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-11-05 12:49:38 +0100 |
| commit | a6446829f841bf108fca8ca1e8f4f67b3a59d86c (patch) | |
| tree | 9145b8df1fe85e2a344017995a7b313d1b11eba6 /init | |
| parent | a4db63b88f16b8a0dae0bf1d8651f7d3c0d24072 (diff) | |
init: Replace simple_strtoul() with kstrtouint() in root_delay_setup()
Replace deprecated simple_strtoul() with kstrtouint() for better error
handling and input validation. Return 0 on parsing failure to indicate
invalid parameter, maintaining existing behavior for valid inputs.
The simple_strtoul() 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/20251103080627.1844645-1-kaushlendra.kumar@intel.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'init')
| -rw-r--r-- | init/do_mounts.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index 6af29da8889e..64d5e25a2cb5 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -120,7 +120,8 @@ static int __init fs_names_setup(char *str) static unsigned int __initdata root_delay; static int __init root_delay_setup(char *str) { - root_delay = simple_strtoul(str, NULL, 0); + if (kstrtouint(str, 0, &root_delay)) + return 0; return 1; } |