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 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 | |||
123 | static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); | 123 | static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id); |
124 | static char *twa_aen_severity_lookup(unsigned char severity_code); | 124 | static char *twa_aen_severity_lookup(unsigned char severity_code); |
125 | static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); | 125 | static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id); |
126 | static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); | 126 | static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
127 | static int twa_chrdev_open(struct inode *inode, struct file *file); | 127 | static int twa_chrdev_open(struct inode *inode, struct file *file); |
128 | static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); | 128 | static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host); |
129 | static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id); | 129 | static 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 */ |
219 | static const struct file_operations twa_fops = { | 219 | static 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 */ |
638 | static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 638 | static 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: | |||
874 | out2: | 877 | out2: |
875 | mutex_unlock(&tw_dev->ioctl_lock); | 878 | mutex_unlock(&tw_dev->ioctl_lock); |
876 | out: | 879 | out: |
880 | unlock_kernel(); | ||
877 | return retval; | 881 | return retval; |
878 | } /* End twa_chrdev_ioctl() */ | 882 | } /* End twa_chrdev_ioctl() */ |
879 | 883 | ||