From: Thorsten Blum Date: Sat, 20 Dec 2025 12:59:31 +0000 (+0100) Subject: devtmpfs: Replace simple_strtoul with kstrtoint in mount_param X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f62af9fd20bea5e3b543cf69655c043cea298bb;p=thirdparty%2Fkernel%2Flinux.git devtmpfs: Replace simple_strtoul with kstrtoint in mount_param Replace simple_strtoul() with the recommended kstrtoint() for parsing the 'devtmpfs.mount=' boot parameter. Unlike simple_strtoul(), which returns an unsigned long, kstrtoint() converts the string directly to int and avoids implicit casting. Check the return value of kstrtoint() and reject invalid values. This adds error handling while preserving behavior for existing values, and removes use of the deprecated simple_strtoul() helper. The current code silently sets 'mount_dev = 0' if parsing fails, instead of leaving the default value (IS_ENABLED(CONFIG_DEVTMPFS_MOUNT)) unchanged. Signed-off-by: Thorsten Blum Link: https://patch.msgid.link/20251220125930.76836-2-thorsten.blum@linux.dev Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index 748ad3698107..b1c4ceb65026 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c @@ -56,8 +56,7 @@ static struct req { static int __init mount_param(char *str) { - mount_dev = simple_strtoul(str, NULL, 0); - return 1; + return kstrtoint(str, 0, &mount_dev) == 0; } __setup("devtmpfs.mount=", mount_param);