aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 16:23:31 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:53 -0400
commit1af46fd72d6c18c1d96ce7f3491b841055e9dcfd (patch)
treea6950a48e99ee1bc65b9bc5d45443aba7ec4e79c
parentb2f2ba01b2a4356e92231669f7e3dcee37ac2fca (diff)
USB Monitor: BKL pushdown
Add explicit lock_kernel() calls to mon_bin_open() Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-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