]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PM: hibernate: fix __setup handler error handling
authorRandy Dunlap <rdunlap@infradead.org>
Mon, 28 Feb 2022 22:05:32 +0000 (14:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 12:14:43 +0000 (14:14 +0200)
[ Upstream commit ba7ffcd4c4da374b0f64666354eeeda7d3827131 ]

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 <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/power/hibernate.c

index 6670a44ec5d45af6369837f483dd7f6e644bc0c3..6abdfdf571ee7034fc65e5a2598d7cf090cfb57b 100644 (file)
@@ -1219,7 +1219,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;
 }