aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/usb-skeleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/usb-skeleton.c')
-rw-r--r--drivers/usb/usb-skeleton.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 61522787f39..e94176bfd27 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kref.h>
+#include <linux/smp_lock.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/mutex.h>
@@ -90,6 +91,7 @@ static int skel_open(struct inode *inode, struct file *file)
int subminor;
int retval = 0;
+ lock_kernel();
subminor = iminor(inode);
interface = usb_find_interface(&skel_driver, subminor);
@@ -135,6 +137,7 @@ static int skel_open(struct inode *inode, struct file *file)
mutex_unlock(&dev->io_mutex);
exit:
+ unlock_kernel();
return retval;
}