From 86266452f80545285c14e20a8024f79c4fb88a86 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Wed, 13 Jan 2010 15:33:15 +0100 Subject: 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 Acked-by: Mauro Carvalho Chehab Cc: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/cdc-wdm.c | 3 +++ drivers/usb/class/usblp.c | 3 +++ drivers/usb/class/usbtmc.c | 3 +++ 3 files changed, 9 insertions(+) (limited to 'drivers/usb/class') diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 18aafcb..b75a3d8 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -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 93b5f85..d53f949 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -56,6 +56,7 @@ #include #include #include +#include #undef DEBUG #include @@ -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 8588c09..426bfc7 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -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; } -- cgit v1.1