Skip to content

Commit

Permalink
bpp: bkl pushdown
Browse files Browse the repository at this point in the history
Put explicit lock_kernel() calls into bpp_open().  It has locking, but I'm
not convinced it won't race with ioctl().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 4541b5e commit 5e9829a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/sbus/char/bpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/timer.h>
#include <linux/ioport.h>
#include <linux/major.h>
#include <linux/smp_lock.h>

#include <asm/uaccess.h>
#include <asm/io.h>
Expand Down Expand Up @@ -429,6 +430,7 @@ static int bpp_open(struct inode *inode, struct file *f)
unsigned minor = iminor(inode);
int ret;

lock_kernel();
spin_lock(&bpp_open_lock);
ret = 0;
if (minor >= BPP_NO) {
Expand All @@ -444,6 +446,7 @@ static int bpp_open(struct inode *inode, struct file *f)
}
}
spin_unlock(&bpp_open_lock);
unlock_kernel();

return ret;
}
Expand Down

0 comments on commit 5e9829a

Please sign in to comment.