aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 17:48:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 17:48:31 -0400
commitd1794f2c5b5817eb79ccc5e00701ca748d1b073a (patch)
tree5a4c98e694e88a8c82f342d0cc9edb2a4cbbef36 /drivers/char/mem.c
parenta41eebab7537890409ea9dfe0fcda9b5fbdb090d (diff)
parent2fceef397f9880b212a74c418290ce69e7ac00eb (diff)
Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits) IB/umad: BKL is not needed for ib_umad_open() IB/uverbs: BKL is not needed for ib_uverbs_open() bf561-coreb: BKL unneeded for open() Call fasync() functions without the BKL snd/PCM: fasync BKL pushdown ipmi: fasync BKL pushdown ecryptfs: fasync BKL pushdown Bluetooth VHCI: fasync BKL pushdown tty_io: fasync BKL pushdown tun: fasync BKL pushdown i2o: fasync BKL pushdown mpt: fasync BKL pushdown Remove BKL from remote_llseek v2 Make FAT users happier by not deadlocking x86-mce: BKL pushdown vmwatchdog: BKL pushdown vmcp: BKL pushdown via-pmu: BKL pushdown uml-random: BKL pushdown uml-mmapper: BKL pushdown ...
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 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
890static int memory_open(struct inode * inode, struct file * filp) 891static 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
942static const struct file_operations memory_fops = { 948static const struct file_operations memory_fops = {