diff options
Diffstat (limited to 'drivers/scsi/3w-9xxx.c')
-rw-r--r-- | drivers/scsi/3w-9xxx.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 1bb774becf25..e20b7bdd4c78 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 | |||
125 | static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); | 125 | static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); |
126 | static char *twa_aen_severity_lookup(unsigned char severity_code); | 126 | static char *twa_aen_severity_lookup(unsigned char severity_code); |
127 | static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); | 127 | static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); |
128 | static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); | 128 | static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
129 | static int twa_chrdev_open(struct inode *inode, struct file *file); | 129 | static int twa_chrdev_open(struct inode *inode, struct file *file); |
130 | static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); | 130 | static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); |
131 | static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id); | 131 | static 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 */ |
221 | static const struct file_operations twa_fops = { | 221 | static 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 */ |
640 | static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 640 | static 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: | |||
876 | out2: | 879 | out2: |
877 | mutex_unlock(&tw_dev->ioctl_lock); | 880 | mutex_unlock(&tw_dev->ioctl_lock); |
878 | out: | 881 | out: |
882 | unlock_kernel(); | ||
879 | return retval; | 883 | return retval; |
880 | } /* End twa_chrdev_ioctl() */ | 884 | } /* End twa_chrdev_ioctl() */ |
881 | 885 | ||