aboutsummaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 19:15:33 +0200
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:54 -0600
commit2861ead38b8a376888c3f63b9c8e45d4cee02117 (patch)
tree3681d8e2aab7d521d33f3d0efb405749c214f57e /drivers/char
parentb82829943c470e59cfd3ee84d8ed6ae5d5e1a55b (diff)
apm-emulation: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/apm-emulation.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index cdd876dbb2b..da8a1658a27 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/slab.h>
+#include <linux/smp_lock.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/miscdevice.h>
@@ -416,6 +417,7 @@ static int apm_open(struct inode * inode, struct file * filp)
{
struct apm_user *as;
+ lock_kernel();
as = kzalloc(sizeof(*as), GFP_KERNEL);
if (as) {
/*
@@ -435,6 +437,7 @@ static int apm_open(struct inode * inode, struct file * filp)
filp->private_data = as;
}
+ unlock_kernel();
return as ? 0 : -ENOMEM;
}