aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/apm-emulation.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/apm-emulation.c')
-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 cdd876dbb2b0..da8a1658a273 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/poll.h> 14#include <linux/poll.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/smp_lock.h>
16#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
17#include <linux/seq_file.h> 18#include <linux/seq_file.h>
18#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
@@ -416,6 +417,7 @@ static int apm_open(struct inode * inode, struct file * filp)
416{ 417{
417 struct apm_user *as; 418 struct apm_user *as;
418 419
420 lock_kernel();
419 as = kzalloc(sizeof(*as), GFP_KERNEL); 421 as = kzalloc(sizeof(*as), GFP_KERNEL);
420 if (as) { 422 if (as) {
421 /* 423 /*
@@ -435,6 +437,7 @@ static int apm_open(struct inode * inode, struct file * filp)
435 437
436 filp->private_data = as; 438 filp->private_data = as;
437 } 439 }
440 unlock_kernel();
438 441
439 return as ? 0 : -ENOMEM; 442 return as ? 0 : -ENOMEM;
440} 443}