diff options
author | Andy Whitcroft <apw@canonical.com> | 2010-12-09 12:42:25 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-09-23 08:47:47 -0600 |
commit | f31d42bf0ff5ab758bfdbe17be29e990b6dc6869 (patch) | |
tree | a45ebaa0f5c67b72f410aebc33074275ad2c7a49 /ubuntu | |
parent | 5f160bc1a68aefd3cbf8802c71323ca3bdf88324 (diff) |
UBUNTU: ubuntu: ndiswrapper -- follow removal of the BKL and locked ioctl
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'ubuntu')
-rw-r--r-- | ubuntu/ndiswrapper/loader.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ubuntu/ndiswrapper/loader.c b/ubuntu/ndiswrapper/loader.c index 5c231c71a47..c5b14f78603 100644 --- a/ubuntu/ndiswrapper/loader.c +++ b/ubuntu/ndiswrapper/loader.c @@ -749,8 +749,10 @@ struct wrap_device *get_wrap_device(void *dev, int bus) return wd; } +static DEFINE_MUTEX(ndiswrapper_ioctl_mutex); + /* called with loader_mutex is down */ -static int wrapper_ioctl(struct inode *inode, struct file *file, +static long wrapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct load_driver *load_driver; @@ -759,6 +761,8 @@ static int wrapper_ioctl(struct inode *inode, struct file *file, int ret; void __user *addr = (void __user *)arg; + mutex_lock(&ndiswrapper_ioctl_mutex); + ENTER1("cmd: %u", cmd); ret = 0; @@ -820,6 +824,9 @@ static int wrapper_ioctl(struct inode *inode, struct file *file, break; } complete(&loader_complete); + + mutex_unlock(&ndiswrapper_ioctl_mutex); + EXIT1(return ret); } @@ -831,7 +838,7 @@ static int wrapper_ioctl_release(struct inode *inode, struct file *file) static struct file_operations wrapper_fops = { .owner = THIS_MODULE, - .ioctl = wrapper_ioctl, + .unlocked_ioctl = wrapper_ioctl, .release = wrapper_ioctl_release, }; |