aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/user.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index f5512cb3aa86..658262b15994 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -23,6 +23,7 @@
23#include <linux/console.h> 23#include <linux/console.h>
24#include <linux/cpu.h> 24#include <linux/cpu.h>
25#include <linux/freezer.h> 25#include <linux/freezer.h>
26#include <linux/smp_lock.h>
26 27
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28 29
@@ -164,8 +165,8 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
164 return res; 165 return res;
165} 166}
166 167
167static int snapshot_ioctl(struct inode *inode, struct file *filp, 168static long snapshot_ioctl(struct file *filp, unsigned int cmd,
168 unsigned int cmd, unsigned long arg) 169 unsigned long arg)
169{ 170{
170 int error = 0; 171 int error = 0;
171 struct snapshot_data *data; 172 struct snapshot_data *data;
@@ -181,6 +182,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
181 182
182 data = filp->private_data; 183 data = filp->private_data;
183 184
185 lock_kernel();
186
184 switch (cmd) { 187 switch (cmd) {
185 188
186 case SNAPSHOT_FREEZE: 189 case SNAPSHOT_FREEZE:
@@ -389,7 +392,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
389 error = -ENOTTY; 392 error = -ENOTTY;
390 393
391 } 394 }
392 395 unlock_kernel();
393 return error; 396 return error;
394} 397}
395 398
@@ -399,7 +402,7 @@ static const struct file_operations snapshot_fops = {
399 .read = snapshot_read, 402 .read = snapshot_read,
400 .write = snapshot_write, 403 .write = snapshot_write,
401 .llseek = no_llseek, 404 .llseek = no_llseek,
402 .ioctl = snapshot_ioctl, 405 .unlocked_ioctl = snapshot_ioctl,
403}; 406};
404 407
405static struct miscdevice snapshot_device = { 408static struct miscdevice snapshot_device = {