aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/user.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 845acd84cb23..bd1771f7a64e 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -49,12 +49,14 @@ static int snapshot_open(struct inode *inode, struct file *filp)
49 if (!atomic_add_unless(&device_available, -1, 0)) 49 if (!atomic_add_unless(&device_available, -1, 0))
50 return -EBUSY; 50 return -EBUSY;
51 51
52 if ((filp->f_flags & O_ACCMODE) == O_RDWR) 52 if ((filp->f_flags & O_ACCMODE) == O_RDWR) {
53 atomic_inc(&device_available);
53 return -ENOSYS; 54 return -ENOSYS;
54 55 }
55 if(create_basic_memory_bitmaps()) 56 if(create_basic_memory_bitmaps()) {
57 atomic_inc(&device_available);
56 return -ENOMEM; 58 return -ENOMEM;
57 59 }
58 nonseekable_open(inode, filp); 60 nonseekable_open(inode, filp);
59 data = &snapshot_state; 61 data = &snapshot_state;
60 filp->private_data = data; 62 filp->private_data = data;