Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[linux-2.6-block.git] / drivers / scsi / aacraid / linit.c
index 1f7c83607f84729a918c640e83a67daf9e45643e..9aa301c1ed07ac5275ceae2635bdbf8c4ecb650e 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/moduleparam.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <linux/spinlock.h>
 #include <linux/syscalls.h>
 #include <linux/delay.h>
@@ -667,6 +668,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
        unsigned minor_number = iminor(inode);
        int err = -ENODEV;
 
+       lock_kernel();  /* BKL pushdown: nothing else protects this list */
        list_for_each_entry(aac, &aac_devices, entry) {
                if (aac->id == minor_number) {
                        file->private_data = aac;
@@ -674,6 +676,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
                        break;
                }
        }
+       unlock_kernel();
 
        return err;
 }
@@ -862,7 +865,7 @@ static ssize_t aac_show_bios_version(struct device *device,
        return len;
 }
 
-ssize_t aac_show_serial_number(struct device *device,
+static ssize_t aac_show_serial_number(struct device *device,
                               struct device_attribute *attr, char *buf)
 {
        struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;