Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100318
b: refs/heads/master
c: 1af46fd
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 7613ae4 commit 13dcec9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2f2ba01b2a4356e92231669f7e3dcee37ac2fca
refs/heads/master: 1af46fd72d6c18c1d96ce7f3491b841055e9dcfd
6 changes: 6 additions & 0 deletions trunk/drivers/usb/mon/mon_bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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:
Expand All @@ -576,6 +581,7 @@ static int mon_bin_open(struct inode *inode, struct file *file)
kfree(rp);
err_alloc:
mutex_unlock(&mon_lock);
unlock_kernel();
return rc;
}

Expand Down

0 comments on commit 13dcec9

Please sign in to comment.