Skip to content

Commit

Permalink
raw: BKL pushdown
Browse files Browse the repository at this point in the history
Put explicit lock_kernel() calls into raw_open(), even though the existing
locking looks adequate.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent b8c71d7 commit c0bed68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/char/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/smp_lock.h>

#include <asm/uaccess.h>

Expand Down Expand Up @@ -53,6 +54,7 @@ static int raw_open(struct inode *inode, struct file *filp)
return 0;
}

lock_kernel();
mutex_lock(&raw_mutex);

/*
Expand All @@ -79,6 +81,7 @@ static int raw_open(struct inode *inode, struct file *filp)
bdev->bd_inode->i_mapping;
filp->private_data = bdev;
mutex_unlock(&raw_mutex);
unlock_kernel();
return 0;

out2:
Expand Down

0 comments on commit c0bed68

Please sign in to comment.