aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-9xxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/3w-9xxx.c')
-rw-r--r--drivers/scsi/3w-9xxx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 1bb774becf2..e20b7bdd4c7 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -125,7 +125,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H
125static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); 125static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
126static char *twa_aen_severity_lookup(unsigned char severity_code); 126static char *twa_aen_severity_lookup(unsigned char severity_code);
127static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); 127static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id);
128static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); 128static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
129static int twa_chrdev_open(struct inode *inode, struct file *file); 129static int twa_chrdev_open(struct inode *inode, struct file *file);
130static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); 130static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host);
131static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id); 131static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
@@ -220,7 +220,7 @@ static struct device_attribute *twa_host_attrs[] = {
220/* File operations struct for character device */ 220/* File operations struct for character device */
221static const struct file_operations twa_fops = { 221static const struct file_operations twa_fops = {
222 .owner = THIS_MODULE, 222 .owner = THIS_MODULE,
223 .ioctl = twa_chrdev_ioctl, 223 .unlocked_ioctl = twa_chrdev_ioctl,
224 .open = twa_chrdev_open, 224 .open = twa_chrdev_open,
225 .release = NULL 225 .release = NULL
226}; 226};
@@ -637,8 +637,9 @@ out:
637} /* End twa_check_srl() */ 637} /* End twa_check_srl() */
638 638
639/* This function handles ioctl for the character device */ 639/* This function handles ioctl for the character device */
640static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 640static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
641{ 641{
642 struct inode *inode = file->f_path.dentry->d_inode;
642 long timeout; 643 long timeout;
643 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; 644 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
644 dma_addr_t dma_handle; 645 dma_addr_t dma_handle;
@@ -657,6 +658,8 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
657 int retval = TW_IOCTL_ERROR_OS_EFAULT; 658 int retval = TW_IOCTL_ERROR_OS_EFAULT;
658 void __user *argp = (void __user *)arg; 659 void __user *argp = (void __user *)arg;
659 660
661 lock_kernel();
662
660 /* Only let one of these through at a time */ 663 /* Only let one of these through at a time */
661 if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { 664 if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) {
662 retval = TW_IOCTL_ERROR_OS_EINTR; 665 retval = TW_IOCTL_ERROR_OS_EINTR;
@@ -876,6 +879,7 @@ out3:
876out2: 879out2:
877 mutex_unlock(&tw_dev->ioctl_lock); 880 mutex_unlock(&tw_dev->ioctl_lock);
878out: 881out:
882 unlock_kernel();
879 return retval; 883 return retval;
880} /* End twa_chrdev_ioctl() */ 884} /* End twa_chrdev_ioctl() */
881 885