Commit 1f439647 authored by Jonathan Corbet's avatar Jonathan Corbet

mem: cdev lock_kernel() pushdown

It's really hard to tell if this is necessary - lots of weird
magic happens by way of map_devmem()
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent ecc38983
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/splice.h> #include <linux/splice.h>
#include <linux/pfn.h> #include <linux/pfn.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -889,6 +890,9 @@ static const struct file_operations kmsg_fops = { ...@@ -889,6 +890,9 @@ static const struct file_operations kmsg_fops = {
static int memory_open(struct inode * inode, struct file * filp) static int memory_open(struct inode * inode, struct file * filp)
{ {
int ret = 0;
lock_kernel();
switch (iminor(inode)) { switch (iminor(inode)) {
case 1: case 1:
filp->f_op = &mem_fops; filp->f_op = &mem_fops;
...@@ -932,11 +936,13 @@ static int memory_open(struct inode * inode, struct file * filp) ...@@ -932,11 +936,13 @@ static int memory_open(struct inode * inode, struct file * filp)
break; break;
#endif #endif
default: default:
unlock_kernel();
return -ENXIO; return -ENXIO;
} }
if (filp->f_op && filp->f_op->open) if (filp->f_op && filp->f_op->open)
return filp->f_op->open(inode,filp); ret = filp->f_op->open(inode,filp);
return 0; unlock_kernel();
return ret;
} }
static const struct file_operations memory_fops = { static const struct file_operations memory_fops = {
......
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