Commit 864fe516 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Corbet

apm_32: BKL pushdown

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 2861ead3
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/smp_lock.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -1544,10 +1545,12 @@ static int do_open(struct inode *inode, struct file *filp) ...@@ -1544,10 +1545,12 @@ static int do_open(struct inode *inode, struct file *filp)
{ {
struct apm_user *as; struct apm_user *as;
lock_kernel();
as = kmalloc(sizeof(*as), GFP_KERNEL); as = kmalloc(sizeof(*as), GFP_KERNEL);
if (as == NULL) { if (as == NULL) {
printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
sizeof(*as)); sizeof(*as));
unlock_kernel();
return -ENOMEM; return -ENOMEM;
} }
as->magic = APM_BIOS_MAGIC; as->magic = APM_BIOS_MAGIC;
...@@ -1569,6 +1572,7 @@ static int do_open(struct inode *inode, struct file *filp) ...@@ -1569,6 +1572,7 @@ static int do_open(struct inode *inode, struct file *filp)
user_list = as; user_list = as;
spin_unlock(&user_list_lock); spin_unlock(&user_list_lock);
filp->private_data = as; filp->private_data = as;
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment