aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn/capi
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 14:15:33 -0600
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:52 -0600
commita237f3bbaab28bb780201f15f6003cf3d2e81024 (patch)
treeef5991cea90e678bf2476f168a31061d2f15803e /drivers/isdn/capi
parentb0061a0ec4d10a69309d0371a01e8b99387009ef (diff)
CAPI: BKL pushdown
Put explicit lock_kernel() calls into capi_open() Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/isdn/capi')
-rw-r--r--drivers/isdn/capi/capi.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 6ca0bb949ad..2095153582f 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -20,6 +20,7 @@
#include <linux/signal.h>
#include <linux/mutex.h>
#include <linux/mm.h>
+#include <linux/smp_lock.h>
#include <linux/timer.h>
#include <linux/wait.h>
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
@@ -983,13 +984,17 @@ capi_ioctl(struct inode *inode, struct file *file,
static int
capi_open(struct inode *inode, struct file *file)
{
+ int ret;
+
+ lock_kernel();
if (file->private_data)
- return -EEXIST;
-
- if ((file->private_data = capidev_alloc()) == NULL)
- return -ENOMEM;
-
- return nonseekable_open(inode, file);
+ ret = -EEXIST;
+ else if ((file->private_data = capidev_alloc()) == NULL)
+ ret = -ENOMEM;
+ else
+ ret = nonseekable_open(inode, file);
+ unlock_kernel();
+ return ret;
}
static int