aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/hdpuftrs/hdpu_cpustate.c9
-rw-r--r--drivers/misc/phantom.c9
-rw-r--r--drivers/misc/sony-laptop.c3
3 files changed, 18 insertions, 3 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)
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 71d1c84e2fa8..186162470090 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -22,6 +22,7 @@
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/cdev.h> 23#include <linux/cdev.h>
24#include <linux/phantom.h> 24#include <linux/phantom.h>
25#include <linux/smp_lock.h>
25 26
26#include <asm/atomic.h> 27#include <asm/atomic.h>
27#include <asm/io.h> 28#include <asm/io.h>
@@ -212,13 +213,17 @@ static int phantom_open(struct inode *inode, struct file *file)
212 struct phantom_device *dev = container_of(inode->i_cdev, 213 struct phantom_device *dev = container_of(inode->i_cdev,
213 struct phantom_device, cdev); 214 struct phantom_device, cdev);
214 215
216 lock_kernel();
215 nonseekable_open(inode, file); 217 nonseekable_open(inode, file);
216 218
217 if (mutex_lock_interruptible(&dev->open_lock)) 219 if (mutex_lock_interruptible(&dev->open_lock)) {
220 unlock_kernel();
218 return -ERESTARTSYS; 221 return -ERESTARTSYS;
222 }
219 223
220 if (dev->opened) { 224 if (dev->opened) {
221 mutex_unlock(&dev->open_lock); 225 mutex_unlock(&dev->open_lock);
226 unlock_kernel();
222 return -EINVAL; 227 return -EINVAL;
223 } 228 }
224 229
@@ -229,7 +234,7 @@ static int phantom_open(struct inode *inode, struct file *file)
229 atomic_set(&dev->counter, 0); 234 atomic_set(&dev->counter, 0);
230 dev->opened++; 235 dev->opened++;
231 mutex_unlock(&dev->open_lock); 236 mutex_unlock(&dev->open_lock);
232 237 unlock_kernel();
233 return 0; 238 return 0;
234} 239}
235 240
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 00e48e2a9c11..60775be22822 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -46,6 +46,7 @@
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/moduleparam.h> 47#include <linux/moduleparam.h>
48#include <linux/init.h> 48#include <linux/init.h>
49#include <linux/smp_lock.h>
49#include <linux/types.h> 50#include <linux/types.h>
50#include <linux/backlight.h> 51#include <linux/backlight.h>
51#include <linux/platform_device.h> 52#include <linux/platform_device.h>
@@ -1927,8 +1928,10 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
1927static int sonypi_misc_open(struct inode *inode, struct file *file) 1928static int sonypi_misc_open(struct inode *inode, struct file *file)
1928{ 1929{
1929 /* Flush input queue on first open */ 1930 /* Flush input queue on first open */
1931 lock_kernel();
1930 if (atomic_inc_return(&sonypi_compat.open_count) == 1) 1932 if (atomic_inc_return(&sonypi_compat.open_count) == 1)
1931 kfifo_reset(sonypi_compat.fifo); 1933 kfifo_reset(sonypi_compat.fifo);
1934 unlock_kernel();
1932 return 0; 1935 return 0;
1933} 1936}
1934 1937