diff options
author | Kees Cook <keescook@chromium.org> | 2014-06-13 22:30:35 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-16 23:29:39 +0200 |
commit | a6e15a39048ec3229b9a53425f4384f55f6cc1b3 (patch) | |
tree | d1f8a005d2b6e85f781f2c9a4ba899614ec55ed8 /kernel/power/user.c | |
parent | Linux 3.16-rc1 (diff) | |
download | linux-a6e15a39048ec3229b9a53425f4384f55f6cc1b3.tar.xz linux-a6e15a39048ec3229b9a53425f4384f55f6cc1b3.zip |
PM / hibernate: introduce "nohibernate" boot parameter
To support using kernel features that are not compatible with hibernation,
this creates the "nohibernate" kernel boot parameter to disable both
hibernation and resume. This allows hibernation support to be a boot-time
choice instead of only a compile-time choice.
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r-- | kernel/power/user.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 98d357584cd6..526e8911460a 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -49,6 +49,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) struct snapshot_data *data; int error; + if (!hibernation_available()) + return -EPERM; + lock_system_sleep(); if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { |