Skip to content

Commit 6ce46a4

Browse files
arndbJonathan Corbet
authored andcommitted
monreader: BKL pushdown
[jmc: added <linux/smp_lock.h>] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 7714936 commit 6ce46a4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/s390/char/monreader.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/module.h>
1212
#include <linux/moduleparam.h>
1313
#include <linux/init.h>
14+
#include <linux/smp_lock.h>
1415
#include <linux/errno.h>
1516
#include <linux/types.h>
1617
#include <linux/kernel.h>
@@ -340,6 +341,7 @@ static int mon_open(struct inode *inode, struct file *filp)
340341
/*
341342
* only one user allowed
342343
*/
344+
lock_kernel();
343345
rc = -EBUSY;
344346
if (test_and_set_bit(MON_IN_USE, &mon_in_use))
345347
goto out;
@@ -377,6 +379,7 @@ static int mon_open(struct inode *inode, struct file *filp)
377379
}
378380
P_INFO("open, established connection to *MONITOR service\n\n");
379381
filp->private_data = monpriv;
382+
unlock_kernel();
380383
return nonseekable_open(inode, filp);
381384

382385
out_path:
@@ -386,6 +389,7 @@ static int mon_open(struct inode *inode, struct file *filp)
386389
out_use:
387390
clear_bit(MON_IN_USE, &mon_in_use);
388391
out:
392+
unlock_kernel();
389393
return rc;
390394
}
391395

0 commit comments

Comments
 (0)