Commit 2861ead3 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Corbet

apm-emulation: BKL pushdown

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent b8282994
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -416,6 +417,7 @@ static int apm_open(struct inode * inode, struct file * filp) ...@@ -416,6 +417,7 @@ static int apm_open(struct inode * inode, struct file * filp)
{ {
struct apm_user *as; struct apm_user *as;
lock_kernel();
as = kzalloc(sizeof(*as), GFP_KERNEL); as = kzalloc(sizeof(*as), GFP_KERNEL);
if (as) { if (as) {
/* /*
...@@ -435,6 +437,7 @@ static int apm_open(struct inode * inode, struct file * filp) ...@@ -435,6 +437,7 @@ static int apm_open(struct inode * inode, struct file * filp)
filp->private_data = as; filp->private_data = as;
} }
unlock_kernel();
return as ? 0 : -ENOMEM; return as ? 0 : -ENOMEM;
} }
......
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