Skip to content

Commit

Permalink
mconsole_proc(): don't mess with file->f_pos
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and torvalds committed Feb 10, 2018
1 parent 878e66d commit 7a50160
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void mconsole_proc(struct mc_request *req)
struct file *file;
int first_chunk = 1;
char *ptr = req->request.data;
loff_t pos = 0;

ptr += strlen("proc");
ptr = skip_spaces(ptr);
Expand All @@ -148,7 +149,7 @@ void mconsole_proc(struct mc_request *req)
}

do {
len = kernel_read(file, buf, PAGE_SIZE - 1, &file->f_pos);
len = kernel_read(file, buf, PAGE_SIZE - 1, &pos);
if (len < 0) {
mconsole_reply(req, "Read of file failed", 1, 0);
goto out_free;
Expand Down

0 comments on commit 7a50160

Please sign in to comment.