summaryrefslogtreecommitdiffstats
path: root/drivers/char/nvram.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 19:16:26 +0200
committerJonathan Corbet <corbet@lwn.net>2008-07-02 15:06:23 -0600
commit930ab4e532623795f934467c452a8c71be2c30fe (patch)
treea17dc331afeeddb2533d20bcd5f66821da919421 /drivers/char/nvram.c
parentfd3e05b6c82ebee06f888482975172028e89382d (diff)
downloadkernel-crypto-930ab4e532623795f934467c452a8c71be2c30fe.tar.gz
kernel-crypto-930ab4e532623795f934467c452a8c71be2c30fe.tar.xz
kernel-crypto-930ab4e532623795f934467c452a8c71be2c30fe.zip
nvram: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/char/nvram.c')
-rw-r--r--drivers/char/nvram.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 98dec380af4..197cd7a0c33 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;
}