aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-9xxx.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-18 17:32:43 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:53 -0400
commitf2b9857eee17797541b845782ade4d7a9d50f843 (patch)
tree914a00afee2ff953199f99f7cf869e3fd83b36bd /drivers/scsi/3w-9xxx.c
parent0b2806768899dba5967bcd4a3b93eaed9a1dc4f3 (diff)
Add a bunch of cycle_kernel_lock() calls
All of the open() functions which don't need the BKL on their face may still depend on its acquisition to serialize opens against driver initialization. So make those functions acquire then release the BKL to be on the safe side. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/scsi/3w-9xxx.c')
-rw-r--r--drivers/scsi/3w-9xxx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 2239d16fb9b5..eaa805df5b00 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -84,6 +84,7 @@
84#include <linux/pci.h> 84#include <linux/pci.h>
85#include <linux/time.h> 85#include <linux/time.h>
86#include <linux/mutex.h> 86#include <linux/mutex.h>
87#include <linux/smp_lock.h>
87#include <asm/io.h> 88#include <asm/io.h>
88#include <asm/irq.h> 89#include <asm/irq.h>
89#include <asm/uaccess.h> 90#include <asm/uaccess.h>
@@ -862,13 +863,13 @@ out:
862} /* End twa_chrdev_ioctl() */ 863} /* End twa_chrdev_ioctl() */
863 864
864/* This function handles open for the character device */ 865/* This function handles open for the character device */
865/* NOTE that this function will race with remove; adding BKL 866/* NOTE that this function will race with remove. */
866 will not help. */
867static int twa_chrdev_open(struct inode *inode, struct file *file) 867static int twa_chrdev_open(struct inode *inode, struct file *file)
868{ 868{
869 unsigned int minor_number; 869 unsigned int minor_number;
870 int retval = TW_IOCTL_ERROR_OS_ENODEV; 870 int retval = TW_IOCTL_ERROR_OS_ENODEV;
871 871
872 cycle_kernel_lock();
872 minor_number = iminor(inode); 873 minor_number = iminor(inode);
873 if (minor_number >= twa_device_extension_count) 874 if (minor_number >= twa_device_extension_count)
874 goto out; 875 goto out;