]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
apm-emulation: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:15:33 +0000 (19:15 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:54 +0000 (14:05 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/char/apm-emulation.c

index cdd876dbb2b0f77ab05e27c37f0671724743537c..da8a1658a273b6253172b0622631796c4af137f0 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/poll.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/miscdevice.h>
@@ -416,6 +417,7 @@ static int apm_open(struct inode * inode, struct file * filp)
 {
        struct apm_user *as;
 
+       lock_kernel();
        as = kzalloc(sizeof(*as), GFP_KERNEL);
        if (as) {
                /*
@@ -435,6 +437,7 @@ static int apm_open(struct inode * inode, struct file * filp)
 
                filp->private_data = as;
        }
+       unlock_kernel();
 
        return as ? 0 : -ENOMEM;
 }