aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/nvram.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 17:48:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 17:48:31 -0400
commitd1794f2c5b5817eb79ccc5e00701ca748d1b073a (patch)
tree5a4c98e694e88a8c82f342d0cc9edb2a4cbbef36 /drivers/char/nvram.c
parenta41eebab7537890409ea9dfe0fcda9b5fbdb090d (diff)
parent2fceef397f9880b212a74c418290ce69e7ac00eb (diff)
Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits) IB/umad: BKL is not needed for ib_umad_open() IB/uverbs: BKL is not needed for ib_uverbs_open() bf561-coreb: BKL unneeded for open() Call fasync() functions without the BKL snd/PCM: fasync BKL pushdown ipmi: fasync BKL pushdown ecryptfs: fasync BKL pushdown Bluetooth VHCI: fasync BKL pushdown tty_io: fasync BKL pushdown tun: fasync BKL pushdown i2o: fasync BKL pushdown mpt: fasync BKL pushdown Remove BKL from remote_llseek v2 Make FAT users happier by not deadlocking x86-mce: BKL pushdown vmwatchdog: BKL pushdown vmcp: BKL pushdown via-pmu: BKL pushdown uml-random: BKL pushdown uml-mmapper: BKL pushdown ...
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 98dec380af49..197cd7a0c332 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -107,6 +107,7 @@
107#include <linux/init.h> 107#include <linux/init.h>
108#include <linux/proc_fs.h> 108#include <linux/proc_fs.h>
109#include <linux/spinlock.h> 109#include <linux/spinlock.h>
110#include <linux/smp_lock.h>
110 111
111#include <asm/io.h> 112#include <asm/io.h>
112#include <asm/uaccess.h> 113#include <asm/uaccess.h>
@@ -333,12 +334,14 @@ nvram_ioctl(struct inode *inode, struct file *file,
333static int 334static int
334nvram_open(struct inode *inode, struct file *file) 335nvram_open(struct inode *inode, struct file *file)
335{ 336{
337 lock_kernel();
336 spin_lock(&nvram_state_lock); 338 spin_lock(&nvram_state_lock);
337 339
338 if ((nvram_open_cnt && (file->f_flags & O_EXCL)) || 340 if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
339 (nvram_open_mode & NVRAM_EXCL) || 341 (nvram_open_mode & NVRAM_EXCL) ||
340 ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) { 342 ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) {
341 spin_unlock(&nvram_state_lock); 343 spin_unlock(&nvram_state_lock);
344 unlock_kernel();
342 return -EBUSY; 345 return -EBUSY;
343 } 346 }
344 347
@@ -349,6 +352,7 @@ nvram_open(struct inode *inode, struct file *file)
349 nvram_open_cnt++; 352 nvram_open_cnt++;
350 353
351 spin_unlock(&nvram_state_lock); 354 spin_unlock(&nvram_state_lock);
355 unlock_kernel();
352 356
353 return 0; 357 return 0;
354} 358}