From c863312de5067f6a619e14b3edb4c5f708ec6e3b Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Thu, 9 Dec 2010 12:42:25 +0000 Subject: UBUNTU: ubuntu: ndiswrapper -- follow removal of the BKL and locked ioctl Signed-off-by: Andy Whitcroft --- ubuntu/ndiswrapper/loader.c | 11 +++++++++-- 1 file 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, }; -- cgit v1.2.3