Skip to content

Commit

Permalink
apm-emulation: BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jun 20, 2008
1 parent b828299 commit 2861ead
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/char/apm-emulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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) {
/*
Expand All @@ -435,6 +437,7 @@ static int apm_open(struct inode * inode, struct file * filp)

filp->private_data = as;
}
unlock_kernel();

return as ? 0 : -ENOMEM;
}
Expand Down

0 comments on commit 2861ead

Please sign in to comment.