]> Git Repo - linux.git/commitdiff
nvram: Drop the BKL from nvram_open()
authorIngo Molnar <[email protected]>
Wed, 14 Oct 2009 15:48:38 +0000 (17:48 +0200)
committerIngo Molnar <[email protected]>
Wed, 14 Oct 2009 15:54:03 +0000 (17:54 +0200)
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 <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Thomas Gleixner <[email protected]>
LKML-Reference: <1255116426[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
drivers/char/nvram.c

index 2100a8f7bd8627fb7a999b3dcf40896d96066fcf..7cf4518c030f2b3a9293c23dd599643739758d1c 100644 (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)
 {
-       lock_kernel();
        spin_lock(&nvram_state_lock);
 
        if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
            (nvram_open_mode & NVRAM_EXCL) ||
            ((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) {
                spin_unlock(&nvram_state_lock);
-               unlock_kernel();
                return -EBUSY;
        }
 
@@ -347,7 +345,6 @@ static int nvram_open(struct inode *inode, struct file *file)
        nvram_open_cnt++;
 
        spin_unlock(&nvram_state_lock);
-       unlock_kernel();
 
        return 0;
 }
This page took 0.056449 seconds and 4 git commands to generate.