forked from Minki/linux
monwriter: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
6ce46a435a
commit
dca67e9d3d
@ -12,6 +12,7 @@
|
|||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/miscdevice.h>
|
#include <linux/miscdevice.h>
|
||||||
@ -179,10 +180,12 @@ static int monwrite_open(struct inode *inode, struct file *filp)
|
|||||||
monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
|
monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
|
||||||
if (!monpriv)
|
if (!monpriv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
lock_kernel();
|
||||||
INIT_LIST_HEAD(&monpriv->list);
|
INIT_LIST_HEAD(&monpriv->list);
|
||||||
monpriv->hdr_to_read = sizeof(monpriv->hdr);
|
monpriv->hdr_to_read = sizeof(monpriv->hdr);
|
||||||
mutex_init(&monpriv->thread_mutex);
|
mutex_init(&monpriv->thread_mutex);
|
||||||
filp->private_data = monpriv;
|
filp->private_data = monpriv;
|
||||||
|
unlock_kernel();
|
||||||
return nonseekable_open(inode, filp);
|
return nonseekable_open(inode, filp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user