aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 17:48:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 17:48:31 -0400
commitd1794f2c5b5817eb79ccc5e00701ca748d1b073a (patch)
tree5a4c98e694e88a8c82f342d0cc9edb2a4cbbef36 /drivers/usb/mon
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/mon')
-rw-r--r--drivers/usb/mon/mon_bin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 49145534e06e..293a46247c3b 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -15,6 +15,7 @@
15#include <linux/poll.h> 15#include <linux/poll.h>
16#include <linux/compat.h> 16#include <linux/compat.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/smp_lock.h>
18 19
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
20 21
@@ -527,14 +528,17 @@ static int mon_bin_open(struct inode *inode, struct file *file)
527 size_t size; 528 size_t size;
528 int rc; 529 int rc;
529 530
531 lock_kernel();
530 mutex_lock(&mon_lock); 532 mutex_lock(&mon_lock);
531 if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) { 533 if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
532 mutex_unlock(&mon_lock); 534 mutex_unlock(&mon_lock);
535 unlock_kernel();
533 return -ENODEV; 536 return -ENODEV;
534 } 537 }
535 if (mbus != &mon_bus0 && mbus->u_bus == NULL) { 538 if (mbus != &mon_bus0 && mbus->u_bus == NULL) {
536 printk(KERN_ERR TAG ": consistency error on open\n"); 539 printk(KERN_ERR TAG ": consistency error on open\n");
537 mutex_unlock(&mon_lock); 540 mutex_unlock(&mon_lock);
541 unlock_kernel();
538 return -ENODEV; 542 return -ENODEV;
539 } 543 }
540 544
@@ -568,6 +572,7 @@ static int mon_bin_open(struct inode *inode, struct file *file)
568 572
569 file->private_data = rp; 573 file->private_data = rp;
570 mutex_unlock(&mon_lock); 574 mutex_unlock(&mon_lock);
575 unlock_kernel();
571 return 0; 576 return 0;
572 577
573err_allocbuff: 578err_allocbuff:
@@ -576,6 +581,7 @@ err_allocvec:
576 kfree(rp); 581 kfree(rp);
577err_alloc: 582err_alloc:
578 mutex_unlock(&mon_lock); 583 mutex_unlock(&mon_lock);
584 unlock_kernel();
579 return rc; 585 return rc;
580} 586}
581 587