diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-07-15 19:19:14 (GMT) |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-07-15 19:19:14 (GMT) |
commit | 0c17e4ceedd35c78b1c7413dbd16279a350be6bc (patch) | |
tree | 313b3b9ca04727f3704464e01d8dd97da1dd534b /drivers/char/nvram.c | |
parent | 19c1d6a34abf73d0baf8e325d018c920fa78dddc (diff) | |
parent | b9d2252c1e44fa83a4e65fdc9eb93db6297c55af (diff) | |
download | linux-fsl-qoriq-0c17e4ceedd35c78b1c7413dbd16279a350be6bc.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-rmk
Diffstat (limited to 'drivers/char/nvram.c')
-rw-r--r-- | drivers/char/nvram.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 98dec38..197cd7a 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c @@ -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> @@ -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; } @@ -349,6 +352,7 @@ nvram_open(struct inode *inode, struct file *file) nvram_open_cnt++; spin_unlock(&nvram_state_lock); + unlock_kernel(); return 0; } |