diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-16 14:23:31 -0600 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 14:05:53 -0600 |
commit | 1af46fd72d6c18c1d96ce7f3491b841055e9dcfd (patch) | |
tree | a6950a48e99ee1bc65b9bc5d45443aba7ec4e79c /drivers | |
parent | b2f2ba01b2a4356e92231669f7e3dcee37ac2fca (diff) |
USB Monitor: BKL pushdown
Add explicit lock_kernel() calls to mon_bin_open()
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/mon/mon_bin.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 49145534e06e..293a46247c3b 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c @@ -15,6 +15,7 @@ #include <linux/poll.h> #include <linux/compat.h> #include <linux/mm.h> +#include <linux/smp_lock.h> #include <asm/uaccess.h> @@ -527,14 +528,17 @@ static int mon_bin_open(struct inode *inode, struct file *file) size_t size; int rc; + lock_kernel(); mutex_lock(&mon_lock); if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) { mutex_unlock(&mon_lock); + unlock_kernel(); return -ENODEV; } if (mbus != &mon_bus0 && mbus->u_bus == NULL) { printk(KERN_ERR TAG ": consistency error on open\n"); mutex_unlock(&mon_lock); + unlock_kernel(); return -ENODEV; } @@ -568,6 +572,7 @@ static int mon_bin_open(struct inode *inode, struct file *file) file->private_data = rp; mutex_unlock(&mon_lock); + unlock_kernel(); return 0; err_allocbuff: @@ -576,6 +581,7 @@ err_allocvec: kfree(rp); err_alloc: mutex_unlock(&mon_lock); + unlock_kernel(); return rc; } |