summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 14:48:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 14:48:31 -0700
commitd1794f2c5b5817eb79ccc5e00701ca748d1b073a (patch)
tree5a4c98e694e88a8c82f342d0cc9edb2a4cbbef36 /drivers/usb
parenta41eebab7537890409ea9dfe0fcda9b5fbdb090d (diff)
parent2fceef397f9880b212a74c418290ce69e7ac00eb (diff)
Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits) IB/umad: BKL is not needed for ib_umad_open() IB/uverbs: BKL is not needed for ib_uverbs_open() bf561-coreb: BKL unneeded for open() Call fasync() functions without the BKL snd/PCM: fasync BKL pushdown ipmi: fasync BKL pushdown ecryptfs: fasync BKL pushdown Bluetooth VHCI: fasync BKL pushdown tty_io: fasync BKL pushdown tun: fasync BKL pushdown i2o: fasync BKL pushdown mpt: fasync BKL pushdown Remove BKL from remote_llseek v2 Make FAT users happier by not deadlocking x86-mce: BKL pushdown vmwatchdog: BKL pushdown vmcp: BKL pushdown via-pmu: BKL pushdown uml-random: BKL pushdown uml-mmapper: BKL pushdown ...
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/devio.c2
-rw-r--r--drivers/usb/core/file.c3
-rw-r--r--drivers/usb/gadget/printer.c3
-rw-r--r--drivers/usb/mon/mon_bin.c6
4 files changed, 13 insertions, 1 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index de17738f3ac..9218cca2104 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -565,6 +565,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
struct dev_state *ps;
int ret;
+ lock_kernel();
/* Protect against simultaneous removal or release */
mutex_lock(&usbfs_mutex);
@@ -611,6 +612,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
if (ret)
kfree(ps);
mutex_unlock(&usbfs_mutex);
+ unlock_kernel();
return ret;
}
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index 8133c99c6c5..c6a95395e52 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -18,6 +18,7 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/rwsem.h>
+#include <linux/smp_lock.h>
#include <linux/usb.h>
#include "usb.h"
@@ -33,6 +34,7 @@ static int usb_open(struct inode * inode, struct file * file)
int err = -ENODEV;
const struct file_operations *old_fops, *new_fops = NULL;
+ lock_kernel();
down_read(&minor_rwsem);
c = usb_minors[minor];
@@ -51,6 +53,7 @@ static int usb_open(struct inode * inode, struct file * file)
fops_put(old_fops);
done:
up_read(&minor_rwsem);
+ unlock_kernel();
return err;
}
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index 76be75e3ab8..ec8f2eb041c 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -462,6 +462,7 @@ printer_open(struct inode *inode, struct file *fd)
unsigned long flags;
int ret = -EBUSY;
+ lock_kernel();
dev = container_of(inode->i_cdev, struct printer_dev, printer_cdev);
spin_lock_irqsave(&dev->lock, flags);
@@ -477,7 +478,7 @@ printer_open(struct inode *inode, struct file *fd)
spin_unlock_irqrestore(&dev->lock, flags);
DBG(dev, "printer_open returned %x\n", ret);
-
+ unlock_kernel();
return ret;
}
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 49145534e06..293a46247c3 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -15,6 +15,7 @@
#include <linux/poll.h>
#include <linux/compat.h>
#include <linux/mm.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
@@ -527,14 +528,17 @@ static int mon_bin_open(struct inode *inode, struct file *file)
size_t size;
int rc;
+ lock_kernel();
mutex_lock(&mon_lock);
if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
mutex_unlock(&mon_lock);
+ unlock_kernel();
return -ENODEV;
}
if (mbus != &mon_bus0 && mbus->u_bus == NULL) {
printk(KERN_ERR TAG ": consistency error on open\n");
mutex_unlock(&mon_lock);
+ unlock_kernel();
return -ENODEV;
}
@@ -568,6 +572,7 @@ static int mon_bin_open(struct inode *inode, struct file *file)
file->private_data = rp;
mutex_unlock(&mon_lock);
+ unlock_kernel();
return 0;
err_allocbuff:
@@ -576,6 +581,7 @@ err_allocvec:
kfree(rp);
err_alloc:
mutex_unlock(&mon_lock);
+ unlock_kernel();
return rc;
}