From: Arnd Bergmann Date: Tue, 20 May 2008 17:15:34 +0000 (+0200) Subject: apm_32: BKL pushdown X-Git-Tag: v2.6.27-rc1~1103^2~79 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=864fe51671c9e44fb9d02765623daac9acc26a8b;p=linux-2.6-omap-h63xx.git apm_32: BKL pushdown Signed-off-by: Arnd Bergmann --- diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index bf9290e2901..82222366477 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -204,6 +204,7 @@ #include #include +#include #include #include #include @@ -1544,10 +1545,12 @@ static int do_open(struct inode *inode, struct file *filp) { struct apm_user *as; + lock_kernel(); as = kmalloc(sizeof(*as), GFP_KERNEL); if (as == NULL) { printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", sizeof(*as)); + unlock_kernel(); return -ENOMEM; } as->magic = APM_BIOS_MAGIC; @@ -1569,6 +1572,7 @@ static int do_open(struct inode *inode, struct file *filp) user_list = as; spin_unlock(&user_list_lock); filp->private_data = as; + unlock_kernel(); return 0; }