diff options
author | Christoph Hellwig <hch@lst.de> | 2017-09-01 11:39:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-09-04 19:05:16 -0400 |
commit | 21cb2559eb510dfbe9b5d0dd31605f44d2cd2891 (patch) | |
tree | e1480e69a62e052804d690aca80549612c07c142 | |
parent | 8e93157bdd4a9718ce8e05c370ab9fe48debb4c2 (diff) |
mconsole: switch to kernel_read
Instead of playing with address limits.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/um/drivers/mconsole_kern.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index af326fb6510d..c4d162a94be9 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
@@ -148,12 +148,7 @@ void mconsole_proc(struct mc_request *req) | |||
148 | } | 148 | } |
149 | 149 | ||
150 | do { | 150 | do { |
151 | loff_t pos = file->f_pos; | 151 | len = kernel_read(file, buf, PAGE_SIZE - 1, &file->f_pos); |
152 | mm_segment_t old_fs = get_fs(); | ||
153 | set_fs(KERNEL_DS); | ||
154 | len = vfs_read(file, buf, PAGE_SIZE - 1, &pos); | ||
155 | set_fs(old_fs); | ||
156 | file->f_pos = pos; | ||
157 | if (len < 0) { | 152 | if (len < 0) { |
158 | mconsole_reply(req, "Read of file failed", 1, 0); | 153 | mconsole_reply(req, "Read of file failed", 1, 0); |
159 | goto out_free; | 154 | goto out_free; |