Skip to content

Commit

Permalink
HID: cdev lock_kernel() pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 72b6704 commit 702e57d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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;
Expand All @@ -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;

}
Expand Down

0 comments on commit 702e57d

Please sign in to comment.