aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/usbtmc.c
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2010-01-13 09:33:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:54:23 -0500
commit86266452f80545285c14e20a8024f79c4fb88a86 (patch)
treeebb0a287f9bf189737d4924536d18b36492fd330 /drivers/usb/class/usbtmc.c
parentf9de332ebf9df71892d52f7eb64af101a647349f (diff)
USB: Push BKL on open down into the drivers
Straightforward push into the drivers to allow auditing individual drivers separately Signed-off-by: Oliver Neukum <oliver@neukum.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/usbtmc.c')
-rw-r--r--drivers/usb/class/usbtmc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 8588c0937a89..426bfc72b9b4 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -26,6 +26,7 @@
26#include <linux/uaccess.h> 26#include <linux/uaccess.h>
27#include <linux/kref.h> 27#include <linux/kref.h>
28#include <linux/mutex.h> 28#include <linux/mutex.h>
29#include <linux/smp_lock.h>
29#include <linux/usb.h> 30#include <linux/usb.h>
30#include <linux/usb/tmc.h> 31#include <linux/usb/tmc.h>
31 32
@@ -113,6 +114,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
113 struct usbtmc_device_data *data; 114 struct usbtmc_device_data *data;
114 int retval = 0; 115 int retval = 0;
115 116
117 lock_kernel();
116 intf = usb_find_interface(&usbtmc_driver, iminor(inode)); 118 intf = usb_find_interface(&usbtmc_driver, iminor(inode));
117 if (!intf) { 119 if (!intf) {
118 printk(KERN_ERR KBUILD_MODNAME 120 printk(KERN_ERR KBUILD_MODNAME
@@ -128,6 +130,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
128 filp->private_data = data; 130 filp->private_data = data;
129 131
130exit: 132exit:
133 unlock_kernel();
131 return retval; 134 return retval;
132} 135}
133 136