]> err.no Git - linux-2.6/commitdiff
monwriter: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:16:18 +0000 (19:16 +0200)
committerJonathan Corbet <corbet@lwn.net>
Wed, 2 Jul 2008 21:06:23 +0000 (15:06 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/s390/char/monwriter.c

index a86c0534cd49f337dbceb8ef2dab3ac2e0115688..4d71aa8c1a7956928e1354cd82f56a70d145c1e2 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/errno.h>
+#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/kernel.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);
        if (!monpriv)
                return -ENOMEM;
+       lock_kernel();
        INIT_LIST_HEAD(&monpriv->list);
        monpriv->hdr_to_read = sizeof(monpriv->hdr);
        mutex_init(&monpriv->thread_mutex);
        filp->private_data = monpriv;
+       unlock_kernel();
        return nonseekable_open(inode, filp);
 }