PM/hibernate: fix __setup handler error handling
Subsystems (2)
PATCH 1/1 PM/hibernate: fix __setup handler error handling
If an invalid value is used in "resumedelay=<seconds>", it is silently ignored. Add a warning message and then let the __setup handler return 1 to indicate that the kernel command line option has been handled.
Fixes 317cf7e5e85e3 ("PM / hibernate: convert simple_strtoul to kstrtoul")
Signed-off-by Randy Dunlap <[email protected]>
Reported-by Igor Zhbanov <[email protected]>
Link lore.kernel.org/r/[email protected]
Cc Fabian Frederick <[email protected]>
Cc Andrew Morton <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Len Brown <[email protected]>
--- kernel/power/hibernate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/hibernate.c +1 -1
@@ -1329,7 +1329,7 @@ static int __init resumedelay_setup(charint rc =kstrtouint (str,0 , &resume_delay);if (rc) -return rc; +pr_warn ("resumedelay: bad option string '%s'\n" , str);return 1 ; }
Quoted 23 lines · Randy Dunlap
If an invalid value is used in "resumedelay=<seconds>", it is silently ignored. Add a warning message and then let the
__setuphandler return 1 to indicate that the kernel command line option has been handled.Fixes 317cf7e5e85e3 ("PM / hibernate: convert simple_strtoul to kstrtoul")Signed-off-by Randy Dunlap <[email protected]>Reported-by Igor Zhbanov <[email protected]>Link lore.kernel.org/r/[email protected]Cc Fabian Frederick <[email protected]>Cc Andrew Morton <[email protected]>Cc "Rafael J. Wysocki" <[email protected]>Cc Pavel Machek <[email protected]>Cc Len Brown <[email protected]>--- kernel/power/hibernate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/hibernate.c static int __init resumedelay_setup(char · line 1334
Quoted 7 lines
kernel/power/hibernate.c +1
-1@@ -1329,7 +1329,7 @@ static int __init resumedelay_setup(charint rc =kstrtouint (str,0 , &resume_delay);if (rc) -return rc; +pr_warn ("resumedelay: bad option string '%s'\n" , str);return 1 ; }
Applied as 5.18 material, thanks!