summaryrefslogtreecommitdiff
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-15 10:25:44 -0600
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:47 -0600
commit702e57d9ef7002f8d362faa6ddebc59e6d43fa05 (patch)
tree62254d1b92499aaebd062833f1eb8921eafdd914 /drivers/hid/hidraw.c
parent72b67048f5dac18fd6494e3d3bff7e54840e8761 (diff)
HID: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/hid/hidraw.c')
-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 1ca6f4635eeb..2fde6c63f47d 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -30,6 +30,7 @@
#include <linux/major.h>
#include <linux/hid.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include <linux/hidraw.h>
@@ -157,6 +158,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
struct hidraw_list *list;
int err = 0;
+ lock_kernel();
if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) {
err = -ENOMEM;
goto out;
@@ -183,6 +185,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
out_unlock:
spin_unlock(&minors_lock);
out:
+ unlock_kernel();
return err;
}