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 e9788f55ab13..4f74850560fe 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -123,7 +123,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H
123static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); 123static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
124static char *twa_aen_severity_lookup(unsigned char severity_code); 124static char *twa_aen_severity_lookup(unsigned char severity_code);
125static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); 125static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id);
126static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); 126static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
127static int twa_chrdev_open(struct inode *inode, struct file *file); 127static int twa_chrdev_open(struct inode *inode, struct file *file);
128static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); 128static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host);
129static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id); 129static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
@@ -218,7 +218,7 @@ static struct device_attribute *twa_host_attrs[] = {
218/* File operations struct for character device */ 218/* File operations struct for character device */
219static const struct file_operations twa_fops = { 219static const struct file_operations twa_fops = {
220 .owner = THIS_MODULE, 220 .owner = THIS_MODULE,
221 .ioctl = twa_chrdev_ioctl, 221 .unlocked_ioctl = twa_chrdev_ioctl,
222 .open = twa_chrdev_open, 222 .open = twa_chrdev_open,
223 .release = NULL 223 .release = NULL
224}; 224};
@@ -635,8 +635,9 @@ out:
635} /* End twa_check_srl() */ 635} /* End twa_check_srl() */
636 636
637/* This function handles ioctl for the character device */ 637/* This function handles ioctl for the character device */
638static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 638static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
639{ 639{
640 struct inode *inode = file->f_path.dentry->d_inode;
640 long timeout; 641 long timeout;
641 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; 642 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
642 dma_addr_t dma_handle; 643 dma_addr_t dma_handle;
@@ -655,6 +656,8 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
655 int retval = TW_IOCTL_ERROR_OS_EFAULT; 656 int retval = TW_IOCTL_ERROR_OS_EFAULT;
656 void __user *argp = (void __user *)arg; 657 void __user *argp = (void __user *)arg;
657 658
659 lock_kernel();
660
658 /* Only let one of these through at a time */ 661 /* Only let one of these through at a time */
659 if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { 662 if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) {
660 retval = TW_IOCTL_ERROR_OS_EINTR; 663 retval = TW_IOCTL_ERROR_OS_EINTR;
@@ -874,6 +877,7 @@ out3:
874out2: 877out2:
875 mutex_unlock(&tw_dev->ioctl_lock); 878 mutex_unlock(&tw_dev->ioctl_lock);
876out: 879out:
880 unlock_kernel();
877 return retval; 881 return retval;
878} /* End twa_chrdev_ioctl() */ 882} /* End twa_chrdev_ioctl() */
879 883