aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/mmapper_kern.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index 6bc73f0e8e29..7e0619c2c2c6 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -37,13 +37,7 @@ static ssize_t mmapper_write(struct file *file, const char __user *buf,
37 if (*ppos > mmapper_size) 37 if (*ppos > mmapper_size)
38 return -EINVAL; 38 return -EINVAL;
39 39
40 if (count > mmapper_size - *ppos) 40 return simple_write_to_buffer(v_buf, mmapper_size, ppos, buf, count);
41 count = mmapper_size - *ppos;
42
43 if (copy_from_user(&v_buf[*ppos], buf, count))
44 return -EFAULT;
45
46 return count;
47} 41}
48 42
49static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 43static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg)