diff options
Diffstat (limited to 'drivers/scsi/osst.c')
-rw-r--r-- | drivers/scsi/osst.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index b219118f8bd6..8dbf1c3afb7b 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -4932,7 +4932,7 @@ static int os_scsi_tape_close(struct inode * inode, struct file * filp) | |||
4932 | 4932 | ||
4933 | 4933 | ||
4934 | /* The ioctl command */ | 4934 | /* The ioctl command */ |
4935 | static int osst_ioctl(struct inode * inode,struct file * file, | 4935 | static long osst_ioctl(struct file * file, |
4936 | unsigned int cmd_in, unsigned long arg) | 4936 | unsigned int cmd_in, unsigned long arg) |
4937 | { | 4937 | { |
4938 | int i, cmd_nr, cmd_type, blk, retval = 0; | 4938 | int i, cmd_nr, cmd_type, blk, retval = 0; |
@@ -4943,8 +4943,11 @@ static int osst_ioctl(struct inode * inode,struct file * file, | |||
4943 | char * name = tape_name(STp); | 4943 | char * name = tape_name(STp); |
4944 | void __user * p = (void __user *)arg; | 4944 | void __user * p = (void __user *)arg; |
4945 | 4945 | ||
4946 | if (mutex_lock_interruptible(&STp->lock)) | 4946 | lock_kernel(); |
4947 | if (mutex_lock_interruptible(&STp->lock)) { | ||
4948 | unlock_kernel(); | ||
4947 | return -ERESTARTSYS; | 4949 | return -ERESTARTSYS; |
4950 | } | ||
4948 | 4951 | ||
4949 | #if DEBUG | 4952 | #if DEBUG |
4950 | if (debugging && !STp->in_use) { | 4953 | if (debugging && !STp->in_use) { |
@@ -5256,12 +5259,15 @@ static int osst_ioctl(struct inode * inode,struct file * file, | |||
5256 | 5259 | ||
5257 | mutex_unlock(&STp->lock); | 5260 | mutex_unlock(&STp->lock); |
5258 | 5261 | ||
5259 | return scsi_ioctl(STp->device, cmd_in, p); | 5262 | retval = scsi_ioctl(STp->device, cmd_in, p); |
5263 | unlock_kernel(); | ||
5264 | return retval; | ||
5260 | 5265 | ||
5261 | out: | 5266 | out: |
5262 | if (SRpnt) osst_release_request(SRpnt); | 5267 | if (SRpnt) osst_release_request(SRpnt); |
5263 | 5268 | ||
5264 | mutex_unlock(&STp->lock); | 5269 | mutex_unlock(&STp->lock); |
5270 | unlock_kernel(); | ||
5265 | 5271 | ||
5266 | return retval; | 5272 | return retval; |
5267 | } | 5273 | } |
@@ -5613,7 +5619,7 @@ static const struct file_operations osst_fops = { | |||
5613 | .owner = THIS_MODULE, | 5619 | .owner = THIS_MODULE, |
5614 | .read = osst_read, | 5620 | .read = osst_read, |
5615 | .write = osst_write, | 5621 | .write = osst_write, |
5616 | .ioctl = osst_ioctl, | 5622 | .unlocked_ioctl = osst_ioctl, |
5617 | #ifdef CONFIG_COMPAT | 5623 | #ifdef CONFIG_COMPAT |
5618 | .compat_ioctl = osst_compat_ioctl, | 5624 | .compat_ioctl = osst_compat_ioctl, |
5619 | #endif | 5625 | #endif |