summaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 14:17:33 -0600
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:52 -0600
commit3462032d66703ef7721329b44fe2dac4aaef475d (patch)
tree5c043d69053609adb41ed9a4a1ec0498170fc852 /drivers/isdn
parenta237f3bbaab28bb780201f15f6003cf3d2e81024 (diff)
downloadop-kernel-dev-3462032d66703ef7721329b44fe2dac4aaef475d.zip
op-kernel-dev-3462032d66703ef7721329b44fe2dac4aaef475d.tar.gz
divamnt: BKL pushdown
Put explicit lock_kernel() calls into maint_open(). Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/eicon/divamnt.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
index c909289..1e85f74 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -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)
OpenPOWER on IntegriCloud