Commit 83cb1672 authored by Ingo Molnar's avatar Ingo Molnar

nvram: Drop the BKL from nvram_open()

It's safe to remove the BKL from nvram_open(): there's no open()
versus read() races: nvram_init() is very simple and race-free,
it registers the device then puts it into /proc - there's no
state init to race with.

Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <1255116426-7270-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 55e858c8
...@@ -329,14 +329,12 @@ static int nvram_ioctl(struct inode *inode, struct file *file, ...@@ -329,14 +329,12 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
static int nvram_open(struct inode *inode, struct file *file) static int nvram_open(struct inode *inode, struct file *file)
{ {
lock_kernel();
spin_lock(&nvram_state_lock); spin_lock(&nvram_state_lock);
if ((nvram_open_cnt && (file->f_flags & O_EXCL)) || if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
(nvram_open_mode & NVRAM_EXCL) || (nvram_open_mode & NVRAM_EXCL) ||
((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) { ((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) {
spin_unlock(&nvram_state_lock); spin_unlock(&nvram_state_lock);
unlock_kernel();
return -EBUSY; return -EBUSY;
} }
...@@ -347,7 +345,6 @@ static int nvram_open(struct inode *inode, struct file *file) ...@@ -347,7 +345,6 @@ static int nvram_open(struct inode *inode, struct file *file)
nvram_open_cnt++; nvram_open_cnt++;
spin_unlock(&nvram_state_lock); spin_unlock(&nvram_state_lock);
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment