aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/monreader.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/monreader.c')
-rw-r--r--drivers/s390/char/monreader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index f0e4c96afbf8..35fd8dfcaaa6 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -10,6 +10,7 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/moduleparam.h> 11#include <linux/moduleparam.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/smp_lock.h>
13#include <linux/errno.h> 14#include <linux/errno.h>
14#include <linux/types.h> 15#include <linux/types.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
@@ -291,6 +292,7 @@ static int mon_open(struct inode *inode, struct file *filp)
291 /* 292 /*
292 * only one user allowed 293 * only one user allowed
293 */ 294 */
295 lock_kernel();
294 rc = -EBUSY; 296 rc = -EBUSY;
295 if (test_and_set_bit(MON_IN_USE, &mon_in_use)) 297 if (test_and_set_bit(MON_IN_USE, &mon_in_use))
296 goto out; 298 goto out;
@@ -327,6 +329,7 @@ static int mon_open(struct inode *inode, struct file *filp)
327 goto out_path; 329 goto out_path;
328 } 330 }
329 filp->private_data = monpriv; 331 filp->private_data = monpriv;
332 unlock_kernel();
330 return nonseekable_open(inode, filp); 333 return nonseekable_open(inode, filp);
331 334
332out_path: 335out_path:
@@ -336,6 +339,7 @@ out_priv:
336out_use: 339out_use:
337 clear_bit(MON_IN_USE, &mon_in_use); 340 clear_bit(MON_IN_USE, &mon_in_use);
338out: 341out:
342 unlock_kernel();
339 return rc; 343 return rc;
340} 344}
341 345