aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/hdpuftrs/hdpu_cpustate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c
index ff51ab67231c..176fe4e09d3f 100644
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c
+++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <linux/smp_lock.h>
20#include <linux/miscdevice.h> 21#include <linux/miscdevice.h>
21#include <linux/proc_fs.h> 22#include <linux/proc_fs.h>
22#include <linux/hdpu_features.h> 23#include <linux/hdpu_features.h>
@@ -151,7 +152,13 @@ static ssize_t cpustate_write(struct file *file, const char *buf,
151 152
152static int cpustate_open(struct inode *inode, struct file *file) 153static int cpustate_open(struct inode *inode, struct file *file)
153{ 154{
154 return cpustate_get_ref((file->f_flags & O_EXCL)); 155 int ret;
156
157 lock_kernel();
158 ret = cpustate_get_ref((file->f_flags & O_EXCL));
159 unlock_kernel();
160
161 return ret;
155} 162}
156 163
157static int cpustate_release(struct inode *inode, struct file *file) 164static int cpustate_release(struct inode *inode, struct file *file)