Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

namespace: Replace simple_strtoul with kstrtoul to parse boot params

Replace simple_strtoul() with the recommended kstrtoul() for parsing the
'mhash_entries=' and 'mphash_entries=' boot parameters.

Check the return value of kstrtoul() and reject invalid values. This
adds error handling while preserving behavior for existing values, and
removes use of the deprecated simple_strtoul() helper.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20251214153141.218953-2-thorsten.blum@linux.dev
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Thorsten Blum and committed by
Christian Brauner
3f320e5c b29a0a37

+2 -8
+2 -8
fs/namespace.c
··· 49 49 static __initdata unsigned long mhash_entries; 50 50 static int __init set_mhash_entries(char *str) 51 51 { 52 - if (!str) 53 - return 0; 54 - mhash_entries = simple_strtoul(str, &str, 0); 55 - return 1; 52 + return kstrtoul(str, 0, &mhash_entries) == 0; 56 53 } 57 54 __setup("mhash_entries=", set_mhash_entries); 58 55 59 56 static __initdata unsigned long mphash_entries; 60 57 static int __init set_mphash_entries(char *str) 61 58 { 62 - if (!str) 63 - return 0; 64 - mphash_entries = simple_strtoul(str, &str, 0); 65 - return 1; 59 + return kstrtoul(str, 0, &mphash_entries) == 0; 66 60 } 67 61 __setup("mphash_entries=", set_mphash_entries); 68 62