summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/apm_32.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 19:15:34 +0200
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:54 -0600
commit864fe51671c9e44fb9d02765623daac9acc26a8b (patch)
tree649c55d5ff0f1651c0929f55a6513a4a22d5a9b2 /arch/x86/kernel/apm_32.c
parent2861ead38b8a376888c3f63b9c8e45d4cee02117 (diff)
apm_32: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/x86/kernel/apm_32.c')
-rw-r--r--arch/x86/kernel/apm_32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index bf9290e29013..82222366477f 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -204,6 +204,7 @@
#include <linux/module.h>
#include <linux/poll.h>
+#include <linux/smp_lock.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/timer.h>
@@ -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;
}