aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-15 13:45:59 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-15 13:45:59 +0200
commit91d0322bef047e2916b3e52741411bffc63929cb (patch)
tree44c4fd13cc17755a6db8a3d70cffb86e57a838dc /drivers/char/mem.c
parent065cb3dfe24978651caedfa54da585388ad15dde (diff)
parent50515af207d410c9f228380e529c56f43c3de0bd (diff)
Merge branch 'linus' into x86/urgent
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 934ffafedae..070e22e8ea9 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -26,6 +26,7 @@
#include <linux/bootmem.h>
#include <linux/splice.h>
#include <linux/pfn.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -889,6 +890,9 @@ static const struct file_operations kmsg_fops = {
static int memory_open(struct inode * inode, struct file * filp)
{
+ int ret = 0;
+
+ lock_kernel();
switch (iminor(inode)) {
case 1:
filp->f_op = &mem_fops;
@@ -932,11 +936,13 @@ static int memory_open(struct inode * inode, struct file * filp)
break;
#endif
default:
+ unlock_kernel();
return -ENXIO;
}
if (filp->f_op && filp->f_op->open)
- return filp->f_op->open(inode,filp);
- return 0;
+ ret = filp->f_op->open(inode,filp);
+ unlock_kernel();
+ return ret;
}
static const struct file_operations memory_fops = {