aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 24d7d78e6f42..d65305b515b1 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -99,6 +99,8 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
99 ssize_t res; 99 ssize_t res;
100 100
101 data = filp->private_data; 101 data = filp->private_data;
102 if (!data->ready)
103 return -ENODATA;
102 res = snapshot_read_next(&data->handle, count); 104 res = snapshot_read_next(&data->handle, count);
103 if (res > 0) { 105 if (res > 0) {
104 if (copy_to_user(buf, data_of(data->handle), res)) 106 if (copy_to_user(buf, data_of(data->handle), res))
@@ -245,7 +247,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
245 break; 247 break;
246 248
247 case SNAPSHOT_UNFREEZE: 249 case SNAPSHOT_UNFREEZE:
248 if (!data->frozen) 250 if (!data->frozen || data->ready)
249 break; 251 break;
250 mutex_lock(&pm_mutex); 252 mutex_lock(&pm_mutex);
251 thaw_processes(); 253 thaw_processes();