aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hardware')
-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 c90928974249..1e85f743214e 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/poll.h> 16#include <linux/poll.h>
17#include <linux/smp_lock.h>
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18 19
19#include "platform.h" 20#include "platform.h"
@@ -127,14 +128,19 @@ static unsigned int maint_poll(struct file *file, poll_table * wait)
127 128
128static int maint_open(struct inode *ino, struct file *filep) 129static int maint_open(struct inode *ino, struct file *filep)
129{ 130{
131 int ret;
132
133 lock_kernel();
130 /* only one open is allowed, so we test 134 /* only one open is allowed, so we test
131 it atomically */ 135 it atomically */
132 if (test_and_set_bit(0, &opened)) 136 if (test_and_set_bit(0, &opened))
133 return (-EBUSY); 137 ret = -EBUSY;
134 138 else {
135 filep->private_data = NULL; 139 filep->private_data = NULL;
136 140 ret = nonseekable_open(ino, filep);
137 return nonseekable_open(ino, filep); 141 }
142 unlock_kernel();
143 return ret;
138} 144}
139 145
140static int maint_close(struct inode *ino, struct file *filep) 146static int maint_close(struct inode *ino, struct file *filep)