From: Arnd Bergmann Date: Tue, 20 May 2008 17:16:26 +0000 (+0200) Subject: nvram: BKL pushdown X-Git-Tag: v2.6.27-rc1~1103^2~40 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=930ab4e532623795f934467c452a8c71be2c30fe;p=linux-2.6-omap-h63xx.git nvram: BKL pushdown Signed-off-by: Arnd Bergmann --- 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 #include #include +#include #include #include @@ -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; }