diff options
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) | |||
49 | struct snapshot_data *data; | 49 | struct snapshot_data *data; |
50 | int error; | 50 | int error; |
51 | 51 | ||
52 | if (!hibernation_available()) | ||
53 | return -EPERM; | ||
54 | |||
52 | lock_system_sleep(); | 55 | lock_system_sleep(); |
53 | 56 | ||
54 | if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { | 57 | if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { |