summaryrefslogtreecommitdiff
path: root/kernel/power/user.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2014-06-13 13:30:35 -0700
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-16 23:29:39 +0200
commita6e15a39048ec3229b9a53425f4384f55f6cc1b3 (patch)
treed1f8a005d2b6e85f781f2c9a4ba899614ec55ed8 /kernel/power/user.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
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.c3
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)) {