aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 16:06:45 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:51 -0400
commit5e9829ad38c24aa71252e643836e7cedcb1c83d7 (patch)
tree7eaa004d9e4b4f402e45354a37bc6d8d1a69beea /drivers/sbus/char
parent4541b5ec9f631a143cdea862d07ddfc3cdac36f2 (diff)
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: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r--drivers/sbus/char/bpp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
index b87037ec9805..c1c091a00575 100644
--- a/drivers/sbus/char/bpp.c
+++ b/drivers/sbus/char/bpp.c
@@ -19,6 +19,7 @@
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/major.h> 21#include <linux/major.h>
22#include <linux/smp_lock.h>
22 23
23#include <asm/uaccess.h> 24#include <asm/uaccess.h>
24#include <asm/io.h> 25#include <asm/io.h>
@@ -429,6 +430,7 @@ static int bpp_open(struct inode *inode, struct file *f)
429 unsigned minor = iminor(inode); 430 unsigned minor = iminor(inode);
430 int ret; 431 int ret;
431 432
433 lock_kernel();
432 spin_lock(&bpp_open_lock); 434 spin_lock(&bpp_open_lock);
433 ret = 0; 435 ret = 0;
434 if (minor >= BPP_NO) { 436 if (minor >= BPP_NO) {
@@ -444,6 +446,7 @@ static int bpp_open(struct inode *inode, struct file *f)
444 } 446 }
445 } 447 }
446 spin_unlock(&bpp_open_lock); 448 spin_unlock(&bpp_open_lock);
449 unlock_kernel();
447 450
448 return ret; 451 return ret;
449} 452}