aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/harddog_kern.c3
-rw-r--r--arch/um/drivers/mmapper_kern.c2
-rw-r--r--arch/um/drivers/random.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index a9ad4bd6d953..d332503fa1be 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -66,6 +66,7 @@ static int harddog_open(struct inode *inode, struct file *file)
66 int err = -EBUSY; 66 int err = -EBUSY;
67 char *sock = NULL; 67 char *sock = NULL;
68 68
69 lock_kernel();
69 spin_lock(&lock); 70 spin_lock(&lock);
70 if(timer_alive) 71 if(timer_alive)
71 goto err; 72 goto err;
@@ -82,9 +83,11 @@ static int harddog_open(struct inode *inode, struct file *file)
82 83
83 timer_alive = 1; 84 timer_alive = 1;
84 spin_unlock(&lock); 85 spin_unlock(&lock);
86 unlock_kernel();
85 return nonseekable_open(inode, file); 87 return nonseekable_open(inode, file);
86err: 88err:
87 spin_unlock(&lock); 89 spin_unlock(&lock);
90 unlock_kernel();
88 return err; 91 return err;
89} 92}
90 93
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index 67b2f55a602f..eb240323c40a 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -16,6 +16,7 @@
16#include <linux/miscdevice.h> 16#include <linux/miscdevice.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp_lock.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
20#include "mem_user.h" 21#include "mem_user.h"
21 22
@@ -77,6 +78,7 @@ out:
77 78
78static int mmapper_open(struct inode *inode, struct file *file) 79static int mmapper_open(struct inode *inode, struct file *file)
79{ 80{
81 cycle_kernel_lock();
80 return 0; 82 return 0;
81} 83}
82 84
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c
index 4949044773ba..6eabb7022a2d 100644
--- a/arch/um/drivers/random.c
+++ b/arch/um/drivers/random.c
@@ -7,6 +7,7 @@
7 * of the GNU General Public License, incorporated herein by reference. 7 * of the GNU General Public License, incorporated herein by reference.
8 */ 8 */
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/smp_lock.h>
10#include <linux/module.h> 11#include <linux/module.h>
11#include <linux/fs.h> 12#include <linux/fs.h>
12#include <linux/interrupt.h> 13#include <linux/interrupt.h>
@@ -33,6 +34,8 @@ static DECLARE_WAIT_QUEUE_HEAD(host_read_wait);
33 34
34static int rng_dev_open (struct inode *inode, struct file *filp) 35static int rng_dev_open (struct inode *inode, struct file *filp)
35{ 36{
37 cycle_kernel_lock();
38
36 /* enforce read-only access to this chrdev */ 39 /* enforce read-only access to this chrdev */
37 if ((filp->f_mode & FMODE_READ) == 0) 40 if ((filp->f_mode & FMODE_READ) == 0)
38 return -EINVAL; 41 return -EINVAL;