]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
bsg: cdev lock_kernel() pushdown
authorJonathan Corbet <corbet@lwn.net>
Thu, 15 May 2008 15:09:23 +0000 (09:09 -0600)
committerJonathan Corbet <corbet@lwn.net>
Sun, 18 May 2008 21:43:40 +0000 (15:43 -0600)
Push the cdev lock_kernel call into bsg_open().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
block/bsg.c

index f0b7cd3432160203ea6c650088ccfcd4acf2a3f6..dbe3ffd505ca80631488626fd042810a8b2e7bac 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/uio.h>
 #include <linux/idr.h>
 #include <linux/bsg.h>
+#include <linux/smp_lock.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_ioctl.h>
@@ -834,7 +835,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)
 
 static int bsg_open(struct inode *inode, struct file *file)
 {
-       struct bsg_device *bd = bsg_get_device(inode, file);
+       struct bsg_device *bd;
+
+       lock_kernel();
+       bd = bsg_get_device(inode, file);
+       unlock_kernel();
 
        if (IS_ERR(bd))
                return PTR_ERR(bd);