diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-16 16:15:33 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:52 -0400 |
commit | a237f3bbaab28bb780201f15f6003cf3d2e81024 (patch) | |
tree | ef5991cea90e678bf2476f168a31061d2f15803e /drivers/isdn/capi | |
parent | b0061a0ec4d10a69309d0371a01e8b99387009ef (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.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 6ca0bb949ad3..2095153582f1 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
23 | #include <linux/smp_lock.h> | ||
23 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
24 | #include <linux/wait.h> | 25 | #include <linux/wait.h> |
25 | #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE | 26 | #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE |
@@ -983,13 +984,17 @@ capi_ioctl(struct inode *inode, struct file *file, | |||
983 | static int | 984 | static int |
984 | capi_open(struct inode *inode, struct file *file) | 985 | capi_open(struct inode *inode, struct file *file) |
985 | { | 986 | { |
987 | int ret; | ||
988 | |||
989 | lock_kernel(); | ||
986 | if (file->private_data) | 990 | if (file->private_data) |
987 | return -EEXIST; | 991 | ret = -EEXIST; |
988 | 992 | else if ((file->private_data = capidev_alloc()) == NULL) | |
989 | if ((file->private_data = capidev_alloc()) == NULL) | 993 | ret = -ENOMEM; |
990 | return -ENOMEM; | 994 | else |
991 | 995 | ret = nonseekable_open(inode, file); | |
992 | return nonseekable_open(inode, file); | 996 | unlock_kernel(); |
997 | return ret; | ||
993 | } | 998 | } |
994 | 999 | ||
995 | static int | 1000 | static int |