Commit 5e9829ad authored by Jonathan Corbet's avatar Jonathan Corbet

bpp: bkl pushdown

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: default avatarJonathan Corbet <corbet@lwn.net>
parent 4541b5ec
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -429,6 +430,7 @@ static int bpp_open(struct inode *inode, struct file *f) ...@@ -429,6 +430,7 @@ static int bpp_open(struct inode *inode, struct file *f)
unsigned minor = iminor(inode); unsigned minor = iminor(inode);
int ret; int ret;
lock_kernel();
spin_lock(&bpp_open_lock); spin_lock(&bpp_open_lock);
ret = 0; ret = 0;
if (minor >= BPP_NO) { if (minor >= BPP_NO) {
...@@ -444,6 +446,7 @@ static int bpp_open(struct inode *inode, struct file *f) ...@@ -444,6 +446,7 @@ static int bpp_open(struct inode *inode, struct file *f)
} }
} }
spin_unlock(&bpp_open_lock); spin_unlock(&bpp_open_lock);
unlock_kernel();
return ret; return ret;
} }
......
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