aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/idmouse.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/misc/idmouse.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/misc/idmouse.c')
-rw-r--r--drivers/usb/misc/idmouse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index a54c3cb804ce..68df9ac76699 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -24,6 +24,7 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/completion.h> 25#include <linux/completion.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <linux/smp_lock.h>
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <linux/usb.h> 29#include <linux/usb.h>
29 30
@@ -226,16 +227,20 @@ static int idmouse_open(struct inode *inode, struct file *file)
226 struct usb_interface *interface; 227 struct usb_interface *interface;
227 int result; 228 int result;
228 229
230 lock_kernel();
229 /* get the interface from minor number and driver information */ 231 /* get the interface from minor number and driver information */
230 interface = usb_find_interface (&idmouse_driver, iminor (inode)); 232 interface = usb_find_interface (&idmouse_driver, iminor (inode));
231 if (!interface) 233 if (!interface) {
234 unlock_kernel();
232 return -ENODEV; 235 return -ENODEV;
236 }
233 237
234 mutex_lock(&open_disc_mutex); 238 mutex_lock(&open_disc_mutex);
235 /* get the device information block from the interface */ 239 /* get the device information block from the interface */
236 dev = usb_get_intfdata(interface); 240 dev = usb_get_intfdata(interface);
237 if (!dev) { 241 if (!dev) {
238 mutex_unlock(&open_disc_mutex); 242 mutex_unlock(&open_disc_mutex);
243 unlock_kernel();
239 return -ENODEV; 244 return -ENODEV;
240 } 245 }
241 246
@@ -272,6 +277,7 @@ error:
272 277
273 /* unlock this device */ 278 /* unlock this device */
274 mutex_unlock(&dev->lock); 279 mutex_unlock(&dev->lock);
280 unlock_kernel();
275 return result; 281 return result;
276} 282}
277 283