aboutsummaryrefslogtreecommitdiff
path: root/drivers/s390/char/vmlogrdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/vmlogrdr.c')
-rw-r--r--drivers/s390/char/vmlogrdr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index a246bc73ae6..c31faefa2b3 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -25,6 +25,7 @@
#include <linux/kmod.h>
#include <linux/cdev.h>
#include <linux/device.h>
+#include <linux/smp_lock.h>
#include <linux/string.h>
@@ -310,9 +311,11 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
return -ENOSYS;
/* Besure this device hasn't already been opened */
+ lock_kernel();
spin_lock_bh(&logptr->priv_lock);
if (logptr->dev_in_use) {
spin_unlock_bh(&logptr->priv_lock);
+ unlock_kernel();
return -EBUSY;
}
logptr->dev_in_use = 1;
@@ -356,7 +359,9 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
|| (logptr->iucv_path_severed));
if (logptr->iucv_path_severed)
goto out_record;
- return nonseekable_open(inode, filp);
+ ret = nonseekable_open(inode, filp);
+ unlock_kernel();
+ return ret;
out_record:
if (logptr->autorecording)
@@ -366,6 +371,7 @@ out_path:
logptr->path = NULL;
out_dev:
logptr->dev_in_use = 0;
+ unlock_kernel();
return -EIO;
}