aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-15 12:25:44 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:47 -0400
commit702e57d9ef7002f8d362faa6ddebc59e6d43fa05 (patch)
tree62254d1b92499aaebd062833f1eb8921eafdd914 /drivers/hid
parent72b67048f5dac18fd6494e3d3bff7e54840e8761 (diff)
HID: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hidraw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 1ca6f4635ee..2fde6c63f47 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -30,6 +30,7 @@
30#include <linux/major.h> 30#include <linux/major.h>
31#include <linux/hid.h> 31#include <linux/hid.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/smp_lock.h>
33 34
34#include <linux/hidraw.h> 35#include <linux/hidraw.h>
35 36
@@ -157,6 +158,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
157 struct hidraw_list *list; 158 struct hidraw_list *list;
158 int err = 0; 159 int err = 0;
159 160
161 lock_kernel();
160 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) { 162 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) {
161 err = -ENOMEM; 163 err = -ENOMEM;
162 goto out; 164 goto out;
@@ -183,6 +185,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
183out_unlock: 185out_unlock:
184 spin_unlock(&minors_lock); 186 spin_unlock(&minors_lock);
185out: 187out:
188 unlock_kernel();
186 return err; 189 return err;
187 190
188} 191}