diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c index 54d617f7df3e..7c59ffaedfe0 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> |
@@ -835,7 +836,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file) | |||
835 | 836 | ||
836 | static int bsg_open(struct inode *inode, struct file *file) | 837 | static int bsg_open(struct inode *inode, struct file *file) |
837 | { | 838 | { |
838 | struct bsg_device *bd = bsg_get_device(inode, file); | 839 | struct bsg_device *bd; |
840 | |||
841 | lock_kernel(); | ||
842 | bd = bsg_get_device(inode, file); | ||
843 | unlock_kernel(); | ||
839 | 844 | ||
840 | if (IS_ERR(bd)) | 845 | if (IS_ERR(bd)) |
841 | return PTR_ERR(bd); | 846 | return PTR_ERR(bd); |