From: Randy Dunlap Date: Mon, 28 Feb 2022 22:05:32 +0000 (-0800) Subject: PM: hibernate: fix __setup handler error handling X-Git-Tag: v5.18-rc1~203^2~2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba7ffcd4c4da374b0f64666354eeeda7d3827131;p=thirdparty%2Fkernel%2Flinux.git PM: hibernate: fix __setup handler error handling If an invalid value is used in "resumedelay=", 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 Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 49d1df0218cb8..0ac805b753e58 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -1330,7 +1330,7 @@ static int __init resumedelay_setup(char *str) int rc = kstrtouint(str, 0, &resume_delay); if (rc) - return rc; + pr_warn("resumedelay: bad option string '%s'\n", str); return 1; }