diff options
author | Oliver Neukum <oliver@neukum.org> | 2010-01-13 14:33:15 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 22:54:23 (GMT) |
commit | 86266452f80545285c14e20a8024f79c4fb88a86 (patch) | |
tree | ebb0a287f9bf189737d4924536d18b36492fd330 /drivers/usb/misc/idmouse.c | |
parent | f9de332ebf9df71892d52f7eb64af101a647349f (diff) | |
download | linux-86266452f80545285c14e20a8024f79c4fb88a86.tar.xz |
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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index a54c3cb..68df9ac 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -24,6 +24,7 @@ #include <linux/module.h> #include <linux/completion.h> #include <linux/mutex.h> +#include <linux/smp_lock.h> #include <asm/uaccess.h> #include <linux/usb.h> @@ -226,16 +227,20 @@ static int idmouse_open(struct inode *inode, struct file *file) struct usb_interface *interface; int result; + lock_kernel(); /* get the interface from minor number and driver information */ interface = usb_find_interface (&idmouse_driver, iminor (inode)); - if (!interface) + if (!interface) { + unlock_kernel(); return -ENODEV; + } mutex_lock(&open_disc_mutex); /* get the device information block from the interface */ dev = usb_get_intfdata(interface); if (!dev) { mutex_unlock(&open_disc_mutex); + unlock_kernel(); return -ENODEV; } @@ -272,6 +277,7 @@ error: /* unlock this device */ mutex_unlock(&dev->lock); + unlock_kernel(); return result; } |