diff options
Diffstat (limited to 'drivers/usb/mon/mon_bin.c')
-rw-r--r-- | drivers/usb/mon/mon_bin.c | 6 |
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 | ||
573 | err_allocbuff: | 578 | err_allocbuff: |
@@ -576,6 +581,7 @@ err_allocvec: | |||
576 | kfree(rp); | 581 | kfree(rp); |
577 | err_alloc: | 582 | err_alloc: |
578 | mutex_unlock(&mon_lock); | 583 | mutex_unlock(&mon_lock); |
584 | unlock_kernel(); | ||
579 | return rc; | 585 | return rc; |
580 | } | 586 | } |
581 | 587 | ||