diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/rtlx.c | 7 | ||||
-rw-r--r-- | arch/mips/kernel/vpe.c | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index b88f1c18ff4d..b55641961232 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/vmalloc.h> | 28 | #include <linux/vmalloc.h> |
29 | #include <linux/elf.h> | 29 | #include <linux/elf.h> |
30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
31 | #include <linux/smp_lock.h> | ||
31 | #include <linux/syscalls.h> | 32 | #include <linux/syscalls.h> |
32 | #include <linux/moduleloader.h> | 33 | #include <linux/moduleloader.h> |
33 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
@@ -392,8 +393,12 @@ out: | |||
392 | static int file_open(struct inode *inode, struct file *filp) | 393 | static int file_open(struct inode *inode, struct file *filp) |
393 | { | 394 | { |
394 | int minor = iminor(inode); | 395 | int minor = iminor(inode); |
396 | int err; | ||
395 | 397 | ||
396 | return rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); | 398 | lock_kernel(); |
399 | err = rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); | ||
400 | unlock_kernel(); | ||
401 | return err; | ||
397 | } | 402 | } |
398 | 403 | ||
399 | static int file_release(struct inode *inode, struct file *filp) | 404 | static int file_release(struct inode *inode, struct file *filp) |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 2794501ff302..972b2d2b8401 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/vmalloc.h> | 38 | #include <linux/vmalloc.h> |
39 | #include <linux/elf.h> | 39 | #include <linux/elf.h> |
40 | #include <linux/seq_file.h> | 40 | #include <linux/seq_file.h> |
41 | #include <linux/smp_lock.h> | ||
41 | #include <linux/syscalls.h> | 42 | #include <linux/syscalls.h> |
42 | #include <linux/moduleloader.h> | 43 | #include <linux/moduleloader.h> |
43 | #include <linux/interrupt.h> | 44 | #include <linux/interrupt.h> |
@@ -1050,17 +1051,20 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1050 | enum vpe_state state; | 1051 | enum vpe_state state; |
1051 | struct vpe_notifications *not; | 1052 | struct vpe_notifications *not; |
1052 | struct vpe *v; | 1053 | struct vpe *v; |
1053 | int ret; | 1054 | int ret, err = 0; |
1054 | 1055 | ||
1056 | lock_kernel(); | ||
1055 | if (minor != iminor(inode)) { | 1057 | if (minor != iminor(inode)) { |
1056 | /* assume only 1 device at the moment. */ | 1058 | /* assume only 1 device at the moment. */ |
1057 | printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); | 1059 | printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); |
1058 | return -ENODEV; | 1060 | err = -ENODEV; |
1061 | goto out; | ||
1059 | } | 1062 | } |
1060 | 1063 | ||
1061 | if ((v = get_vpe(tclimit)) == NULL) { | 1064 | if ((v = get_vpe(tclimit)) == NULL) { |
1062 | printk(KERN_WARNING "VPE loader: unable to get vpe\n"); | 1065 | printk(KERN_WARNING "VPE loader: unable to get vpe\n"); |
1063 | return -ENODEV; | 1066 | err = -ENODEV; |
1067 | goto out; | ||
1064 | } | 1068 | } |
1065 | 1069 | ||
1066 | state = xchg(&v->state, VPE_STATE_INUSE); | 1070 | state = xchg(&v->state, VPE_STATE_INUSE); |
@@ -1100,6 +1104,8 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1100 | v->shared_ptr = NULL; | 1104 | v->shared_ptr = NULL; |
1101 | v->__start = 0; | 1105 | v->__start = 0; |
1102 | 1106 | ||
1107 | out: | ||
1108 | unlock_kernel(); | ||
1103 | return 0; | 1109 | return 0; |
1104 | } | 1110 | } |
1105 | 1111 | ||