]> err.no Git - linux-2.6/commitdiff
divamnt: BKL pushdown
authorJonathan Corbet <corbet@lwn.net>
Fri, 16 May 2008 20:17:33 +0000 (14:17 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:52 +0000 (14:05 -0600)
Put explicit lock_kernel() calls into maint_open().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/isdn/hardware/eicon/divamnt.c

index c90928974249b6acf52996e8929a202d0ad6571f..1e85f743214e3507a03eabd05a829539d86e300d 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/poll.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 
 #include "platform.h"
@@ -127,14 +128,19 @@ static unsigned int maint_poll(struct file *file, poll_table * wait)
 
 static int maint_open(struct inode *ino, struct file *filep)
 {
+       int ret;
+
+       lock_kernel();
        /* only one open is allowed, so we test
           it atomically */
        if (test_and_set_bit(0, &opened))
-               return (-EBUSY);
-
-       filep->private_data = NULL;
-
-       return nonseekable_open(ino, filep);
+               ret = -EBUSY;
+       else {
+               filep->private_data = NULL;
+               ret = nonseekable_open(ino, filep);
+       }
+       unlock_kernel();
+       return ret;
 }
 
 static int maint_close(struct inode *ino, struct file *filep)