Commit 49f15255 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

USB: sisusb: Push down the BKL

This is another case where the lock_kernel appears to be unneccessary and
could be removed with a bit more investigative work
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 54592157
...@@ -2982,9 +2982,8 @@ sisusb_handle_command(struct sisusb_usb_data *sisusb, struct sisusb_command *y, ...@@ -2982,9 +2982,8 @@ sisusb_handle_command(struct sisusb_usb_data *sisusb, struct sisusb_command *y,
return retval; return retval;
} }
static int static long
sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
unsigned long arg)
{ {
struct sisusb_usb_data *sisusb; struct sisusb_usb_data *sisusb;
struct sisusb_info x; struct sisusb_info x;
...@@ -2995,6 +2994,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -2995,6 +2994,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
return -ENODEV; return -ENODEV;
lock_kernel();
mutex_lock(&sisusb->lock); mutex_lock(&sisusb->lock);
/* Sanity check */ /* Sanity check */
...@@ -3053,6 +3053,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -3053,6 +3053,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
err_out: err_out:
mutex_unlock(&sisusb->lock); mutex_unlock(&sisusb->lock);
unlock_kernel();
return retval; return retval;
} }
...@@ -3066,9 +3067,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg) ...@@ -3066,9 +3067,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
case SISUSB_GET_CONFIG_SIZE: case SISUSB_GET_CONFIG_SIZE:
case SISUSB_GET_CONFIG: case SISUSB_GET_CONFIG:
case SISUSB_COMMAND: case SISUSB_COMMAND:
lock_kernel(); retval = sisusb_ioctl(f, cmd, arg);
retval = sisusb_ioctl(f->f_path.dentry->d_inode, f, cmd, arg);
unlock_kernel();
return retval; return retval;
default: default:
...@@ -3087,7 +3086,7 @@ static const struct file_operations usb_sisusb_fops = { ...@@ -3087,7 +3086,7 @@ static const struct file_operations usb_sisusb_fops = {
#ifdef SISUSB_NEW_CONFIG_COMPAT #ifdef SISUSB_NEW_CONFIG_COMPAT
.compat_ioctl = sisusb_compat_ioctl, .compat_ioctl = sisusb_compat_ioctl,
#endif #endif
.ioctl = sisusb_ioctl .unlocked_ioctl = sisusb_ioctl
}; };
static struct usb_class_driver usb_sisusb_class = { static struct usb_class_driver usb_sisusb_class = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment