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 93e757d7174b..0b3b282f0384 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> |
@@ -851,7 +852,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file) | |||
851 | 852 | ||
852 | static int bsg_open(struct inode *inode, struct file *file) | 853 | static int bsg_open(struct inode *inode, struct file *file) |
853 | { | 854 | { |
854 | struct bsg_device *bd = bsg_get_device(inode, file); | 855 | struct bsg_device *bd; |
856 | |||
857 | lock_kernel(); | ||
858 | bd = bsg_get_device(inode, file); | ||
859 | unlock_kernel(); | ||
855 | 860 | ||
856 | if (IS_ERR(bd)) | 861 | if (IS_ERR(bd)) |
857 | return PTR_ERR(bd); | 862 | return PTR_ERR(bd); |