提交 ea412bcf 编写于 作者: R Randy Dunlap 提交者: Zheng Zengkai

PM: hibernate: fix __setup handler error handling

stable inclusion
from stable-v5.10.110
commit 052a218db0cb7b3d203fd54ce2097ea43253105c
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=052a218db0cb7b3d203fd54ce2097ea43253105c

--------------------------------

[ Upstream commit ba7ffcd4 ]

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: 317cf7e5 ("PM / hibernate: convert simple_strtoul to kstrtoul")
Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
Reported-by: NIgor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 d39791c5
...@@ -1323,7 +1323,7 @@ static int __init resumedelay_setup(char *str) ...@@ -1323,7 +1323,7 @@ static int __init resumedelay_setup(char *str)
int rc = kstrtouint(str, 0, &resume_delay); int rc = kstrtouint(str, 0, &resume_delay);
if (rc) if (rc)
return rc; pr_warn("resumedelay: bad option string '%s'\n", str);
return 1; return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册