summaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/cdc-wdm.c3
-rw-r--r--drivers/usb/class/usblp.c3
-rw-r--r--drivers/usb/class/usbtmc.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 18aafcb08fc8..b75a3d8bb02f 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -19,6 +19,7 @@
#include <linux/uaccess.h>
#include <linux/bitops.h>
#include <linux/poll.h>
+#include <linux/smp_lock.h>
#include <linux/usb.h>
#include <linux/usb/cdc.h>
#include <asm/byteorder.h>
@@ -516,6 +517,7 @@ static int wdm_open(struct inode *inode, struct file *file)
struct usb_interface *intf;
struct wdm_device *desc;
+ lock_kernel();
mutex_lock(&wdm_mutex);
intf = usb_find_interface(&wdm_driver, minor);
if (!intf)
@@ -548,6 +550,7 @@ static int wdm_open(struct inode *inode, struct file *file)
usb_autopm_put_interface(desc->intf);
out:
mutex_unlock(&wdm_mutex);
+ unlock_kernel();
return rv;
}
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 93b5f85d7ceb..d53f9499f936 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -56,6 +56,7 @@
#include <linux/slab.h>
#include <linux/lp.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#undef DEBUG
#include <linux/usb.h>
@@ -395,6 +396,7 @@ static int usblp_open(struct inode *inode, struct file *file)
if (minor < 0)
return -ENODEV;
+ lock_kernel();
mutex_lock (&usblp_mutex);
retval = -ENODEV;
@@ -434,6 +436,7 @@ static int usblp_open(struct inode *inode, struct file *file)
}
out:
mutex_unlock (&usblp_mutex);
+ unlock_kernel();
return retval;
}
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 @@
#include <linux/uaccess.h>
#include <linux/kref.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include <linux/usb.h>
#include <linux/usb/tmc.h>
@@ -113,6 +114,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
struct usbtmc_device_data *data;
int retval = 0;
+ lock_kernel();
intf = usb_find_interface(&usbtmc_driver, iminor(inode));
if (!intf) {
printk(KERN_ERR KBUILD_MODNAME
@@ -128,6 +130,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
filp->private_data = data;
exit:
+ unlock_kernel();
return retval;
}
OpenPOWER on IntegriCloud