diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 13:04:19 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:48 -0400 |
commit | 1f439647a4072ec64bb2e4b9290cd7be6aee8328 (patch) | |
tree | 3ffcaa8ff39ea1324fe60bbc4fd35c6f77141083 /drivers/char/mem.c | |
parent | ecc38983f6c83f371fefb5a69a72e358fc7b1218 (diff) |
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: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r-- | drivers/char/mem.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 934ffafedaea..070e22e8ea9e 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/bootmem.h> | 26 | #include <linux/bootmem.h> |
27 | #include <linux/splice.h> | 27 | #include <linux/splice.h> |
28 | #include <linux/pfn.h> | 28 | #include <linux/pfn.h> |
29 | #include <linux/smp_lock.h> | ||
29 | 30 | ||
30 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
31 | #include <asm/io.h> | 32 | #include <asm/io.h> |
@@ -889,6 +890,9 @@ static const struct file_operations kmsg_fops = { | |||
889 | 890 | ||
890 | static int memory_open(struct inode * inode, struct file * filp) | 891 | static int memory_open(struct inode * inode, struct file * filp) |
891 | { | 892 | { |
893 | int ret = 0; | ||
894 | |||
895 | lock_kernel(); | ||
892 | switch (iminor(inode)) { | 896 | switch (iminor(inode)) { |
893 | case 1: | 897 | case 1: |
894 | filp->f_op = &mem_fops; | 898 | filp->f_op = &mem_fops; |
@@ -932,11 +936,13 @@ static int memory_open(struct inode * inode, struct file * filp) | |||
932 | break; | 936 | break; |
933 | #endif | 937 | #endif |
934 | default: | 938 | default: |
939 | unlock_kernel(); | ||
935 | return -ENXIO; | 940 | return -ENXIO; |
936 | } | 941 | } |
937 | if (filp->f_op && filp->f_op->open) | 942 | if (filp->f_op && filp->f_op->open) |
938 | return filp->f_op->open(inode,filp); | 943 | ret = filp->f_op->open(inode,filp); |
939 | return 0; | 944 | unlock_kernel(); |
945 | return ret; | ||
940 | } | 946 | } |
941 | 947 | ||
942 | static const struct file_operations memory_fops = { | 948 | static const struct file_operations memory_fops = { |