aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c
index f0b7cd343216..dbe3ffd505ca 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -19,6 +19,7 @@
19#include <linux/uio.h> 19#include <linux/uio.h>
20#include <linux/idr.h> 20#include <linux/idr.h>
21#include <linux/bsg.h> 21#include <linux/bsg.h>
22#include <linux/smp_lock.h>
22 23
23#include <scsi/scsi.h> 24#include <scsi/scsi.h>
24#include <scsi/scsi_ioctl.h> 25#include <scsi/scsi_ioctl.h>
@@ -834,7 +835,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)
834 835
835static int bsg_open(struct inode *inode, struct file *file) 836static int bsg_open(struct inode *inode, struct file *file)
836{ 837{
837 struct bsg_device *bd = bsg_get_device(inode, file); 838 struct bsg_device *bd;
839
840 lock_kernel();
841 bd = bsg_get_device(inode, file);
842 unlock_kernel();
838 843
839 if (IS_ERR(bd)) 844 if (IS_ERR(bd))
840 return PTR_ERR(bd); 845 return PTR_ERR(bd);