aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/harddog_kern.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index d332503fa1be..cfcac1ff4cf2 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -124,8 +124,8 @@ static ssize_t harddog_write(struct file *file, const char __user *data, size_t
124 return 0; 124 return 0;
125} 125}
126 126
127static int harddog_ioctl(struct inode *inode, struct file *file, 127static int harddog_ioctl_unlocked(struct file *file,
128 unsigned int cmd, unsigned long arg) 128 unsigned int cmd, unsigned long arg)
129{ 129{
130 void __user *argp= (void __user *)arg; 130 void __user *argp= (void __user *)arg;
131 static struct watchdog_info ident = { 131 static struct watchdog_info ident = {
@@ -148,10 +148,22 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
148 } 148 }
149} 149}
150 150
151static long harddog_ioctl(struct file *file,
152 unsigned int cmd, unsigned long arg)
153{
154 long ret;
155
156 lock_kernel();
157 ret = harddog_ioctl_unlocked(file, cmd, arg);
158 unlock_kernel();
159
160 return ret;
161}
162
151static const struct file_operations harddog_fops = { 163static const struct file_operations harddog_fops = {
152 .owner = THIS_MODULE, 164 .owner = THIS_MODULE,
153 .write = harddog_write, 165 .write = harddog_write,
154 .ioctl = harddog_ioctl, 166 .unlocked_ioctl = harddog_ioctl,
155 .open = harddog_open, 167 .open = harddog_open,
156 .release = harddog_release, 168 .release = harddog_release,
157}; 169};