From 324bb0ae6056806d1ab5a9c6a55ad93095df8449 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 20 May 2008 19:15:34 +0200 Subject: [PATCH] --- yaml --- r: 100330 b: refs/heads/master c: 864fe51671c9e44fb9d02765623daac9acc26a8b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/apm_32.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index b65e71d0859d..00afc5440cd8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2861ead38b8a376888c3f63b9c8e45d4cee02117 +refs/heads/master: 864fe51671c9e44fb9d02765623daac9acc26a8b diff --git a/trunk/arch/x86/kernel/apm_32.c b/trunk/arch/x86/kernel/apm_32.c index bf9290e29013..82222366477f 100644 --- a/trunk/arch/x86/kernel/apm_32.c +++ b/trunk/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; }