diff options
Diffstat (limited to 'drivers/char/nvram.c')
-rw-r--r-- | drivers/char/nvram.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index fdbcc9fd6d31..5eb83c3ca20d 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c | |||
@@ -336,14 +336,12 @@ static int nvram_ioctl(struct inode *inode, struct file *file, | |||
336 | 336 | ||
337 | static int nvram_open(struct inode *inode, struct file *file) | 337 | static int nvram_open(struct inode *inode, struct file *file) |
338 | { | 338 | { |
339 | lock_kernel(); | ||
340 | spin_lock(&nvram_state_lock); | 339 | spin_lock(&nvram_state_lock); |
341 | 340 | ||
342 | if ((nvram_open_cnt && (file->f_flags & O_EXCL)) || | 341 | if ((nvram_open_cnt && (file->f_flags & O_EXCL)) || |
343 | (nvram_open_mode & NVRAM_EXCL) || | 342 | (nvram_open_mode & NVRAM_EXCL) || |
344 | ((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) { | 343 | ((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) { |
345 | spin_unlock(&nvram_state_lock); | 344 | spin_unlock(&nvram_state_lock); |
346 | unlock_kernel(); | ||
347 | return -EBUSY; | 345 | return -EBUSY; |
348 | } | 346 | } |
349 | 347 | ||
@@ -354,7 +352,6 @@ static int nvram_open(struct inode *inode, struct file *file) | |||
354 | nvram_open_cnt++; | 352 | nvram_open_cnt++; |
355 | 353 | ||
356 | spin_unlock(&nvram_state_lock); | 354 | spin_unlock(&nvram_state_lock); |
357 | unlock_kernel(); | ||
358 | 355 | ||
359 | return 0; | 356 | return 0; |
360 | } | 357 | } |