diff options
author | Arnd Bergmann <arnd@arndb.de> | 2008-05-20 13:15:34 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:54 -0400 |
commit | 864fe51671c9e44fb9d02765623daac9acc26a8b (patch) | |
tree | 649c55d5ff0f1651c0929f55a6513a4a22d5a9b2 /arch | |
parent | 2861ead38b8a376888c3f63b9c8e45d4cee02117 (diff) |
apm_32: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/apm_32.c | 4 |
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 @@ | |||
204 | #include <linux/module.h> | 204 | #include <linux/module.h> |
205 | 205 | ||
206 | #include <linux/poll.h> | 206 | #include <linux/poll.h> |
207 | #include <linux/smp_lock.h> | ||
207 | #include <linux/types.h> | 208 | #include <linux/types.h> |
208 | #include <linux/stddef.h> | 209 | #include <linux/stddef.h> |
209 | #include <linux/timer.h> | 210 | #include <linux/timer.h> |
@@ -1544,10 +1545,12 @@ static int do_open(struct inode *inode, struct file *filp) | |||
1544 | { | 1545 | { |
1545 | struct apm_user *as; | 1546 | struct apm_user *as; |
1546 | 1547 | ||
1548 | lock_kernel(); | ||
1547 | as = kmalloc(sizeof(*as), GFP_KERNEL); | 1549 | as = kmalloc(sizeof(*as), GFP_KERNEL); |
1548 | if (as == NULL) { | 1550 | if (as == NULL) { |
1549 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", | 1551 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", |
1550 | sizeof(*as)); | 1552 | sizeof(*as)); |
1553 | unlock_kernel(); | ||
1551 | return -ENOMEM; | 1554 | return -ENOMEM; |
1552 | } | 1555 | } |
1553 | as->magic = APM_BIOS_MAGIC; | 1556 | as->magic = APM_BIOS_MAGIC; |
@@ -1569,6 +1572,7 @@ static int do_open(struct inode *inode, struct file *filp) | |||
1569 | user_list = as; | 1572 | user_list = as; |
1570 | spin_unlock(&user_list_lock); | 1573 | spin_unlock(&user_list_lock); |
1571 | filp->private_data = as; | 1574 | filp->private_data = as; |
1575 | unlock_kernel(); | ||
1572 | return 0; | 1576 | return 0; |
1573 | } | 1577 | } |
1574 | 1578 | ||