Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100369
b: refs/heads/master
c: 930ab4e
h: refs/heads/master
i:
  100367: f0b274d
v: v3
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jul 2, 2008
1 parent bf50726 commit 589dc7e
Show file tree
Hide file tree
Showing 2 changed files with 5 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: fd3e05b6c82ebee06f888482975172028e89382d
refs/heads/master: 930ab4e532623795f934467c452a8c71be2c30fe
4 changes: 4 additions & 0 deletions trunk/drivers/char/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>

#include <asm/io.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -333,12 +334,14 @@ nvram_ioctl(struct inode *inode, struct file *file,
static int
nvram_open(struct inode *inode, struct file *file)
{
lock_kernel();
spin_lock(&nvram_state_lock);

if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
(nvram_open_mode & NVRAM_EXCL) ||
((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) {
spin_unlock(&nvram_state_lock);
unlock_kernel();
return -EBUSY;
}

Expand All @@ -349,6 +352,7 @@ nvram_open(struct inode *inode, struct file *file)
nvram_open_cnt++;

spin_unlock(&nvram_state_lock);
unlock_kernel();

return 0;
}
Expand Down

0 comments on commit 589dc7e

Please sign in to comment.