linux-stable/kernel/power
Randy Dunlap 7e45fc93dd PM: suspend: fix return value of __setup handler
[ Upstream commit 7a64ca17e4 ]

If an invalid option is given for "test_suspend=<option>", the entire
string is added to init's environment, so return 1 instead of 0 from
the __setup handler.

  Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc5
    test_suspend=invalid"

and

 Run /sbin/init as init process
   with arguments:
     /sbin/init
   with environment:
     HOME=/
     TERM=linux
     BOOT_IMAGE=/boot/bzImage-517rc5
     test_suspend=invalid

Fixes: 2ce986892f ("PM / sleep: Enhance test_suspend option with repeat capability")
Fixes: 27ddcc6596 ("PM / sleep: Add state field to pm_states[] entries")
Fixes: a9d7052363 ("PM: Separate suspend to RAM functionality from core")
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>
2022-04-08 14:23:07 +02:00
..
Kconfig PM: sleep: remove trailing spaces and tabs 2021-06-11 18:49:09 +02:00
Makefile PM: hibernate: Split off snapshot dev option 2020-05-19 17:48:08 +02:00
autosleep.c PM: sleep: fix typos in comments 2021-04-08 19:37:21 +02:00
console.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
energy_model.c PM: EM: Fix inefficient states detection 2021-11-18 19:16:30 +01:00
hibernate.c PM: hibernate: fix __setup handler error handling 2022-04-08 14:23:07 +02:00
main.c PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-16 12:56:19 +01:00
power.h kernel/power: allow hibernation with page_poison sanity checking 2020-12-15 12:13:46 -08:00
poweroff.c kernel/power: constify sysrq_key_op 2020-05-15 14:53:20 +02:00
process.c PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-16 12:56:19 +01:00
qos.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
snapshot.c PM: hibernate: Remove register_nosave_region_late() 2022-02-16 12:56:15 +01:00
suspend.c PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-16 12:56:19 +01:00
suspend_test.c PM: suspend: fix return value of __setup handler 2022-04-08 14:23:07 +02:00
swap.c PM: hibernate: fix sparse warnings 2021-11-18 19:16:38 +01:00
user.c block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
wakelock.c PM: wakeup: simplify the output logic of pm_show_wakelocks() 2022-02-01 17:27:00 +01:00