Commit 824f16fd authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

USB: iowarrior: Push down BKL

I'm pretty sure the mutex is sufficient for all locking but will come
back to that later if the USB folks don't beat me to it. For now get rid
of the old BKL ioctl method and wrap the ioctl handler
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5cb4aeca
...@@ -474,8 +474,8 @@ exit: ...@@ -474,8 +474,8 @@ exit:
/** /**
* iowarrior_ioctl * iowarrior_ioctl
*/ */
static int iowarrior_ioctl(struct inode *inode, struct file *file, static long iowarrior_ioctl(struct file *file, unsigned int cmd,
unsigned int cmd, unsigned long arg) unsigned long arg)
{ {
struct iowarrior *dev = NULL; struct iowarrior *dev = NULL;
__u8 *buffer; __u8 *buffer;
...@@ -493,6 +493,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file, ...@@ -493,6 +493,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
return -ENOMEM; return -ENOMEM;
/* lock this object */ /* lock this object */
lock_kernel();
mutex_lock(&dev->mutex); mutex_lock(&dev->mutex);
/* verify that the device wasn't unplugged */ /* verify that the device wasn't unplugged */
...@@ -584,6 +585,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file, ...@@ -584,6 +585,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
error_out: error_out:
/* unlock the device */ /* unlock the device */
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
unlock_kernel();
kfree(buffer); kfree(buffer);
return retval; return retval;
} }
...@@ -719,7 +721,7 @@ static const struct file_operations iowarrior_fops = { ...@@ -719,7 +721,7 @@ static const struct file_operations iowarrior_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.write = iowarrior_write, .write = iowarrior_write,
.read = iowarrior_read, .read = iowarrior_read,
.ioctl = iowarrior_ioctl, .unlocked_ioctl = iowarrior_ioctl,
.open = iowarrior_open, .open = iowarrior_open,
.release = iowarrior_release, .release = iowarrior_release,
.poll = iowarrior_poll, .poll = iowarrior_poll,
......
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