mconsole_proc(): don't mess with file->f_pos
"Linux Kernel Mailing List" <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.head |
|---|---|
| Message-ID | <[email protected]> |
Web: https://git.kernel.org/torvalds/c/7a501609c2cb73381e925827c504a4c2c2cb0817 Commit: 7a501609c2cb73381e925827c504a4c2c2cb0817 Parent: 878e66d06fd098a744b9caafdd0e99bba415ce37 Refname: refs/heads/master Author: Al Viro <[email protected]> AuthorDate: Sat Feb 10 01:35:16 2018 +0000 Committer: Linus Torvalds <[email protected]> CommitDate: Fri Feb 9 19:28:01 2018 -0800 mconsole_proc(): don't mess with file->f_pos Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> --- arch/um/drivers/mconsole_kern.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index c4d162a94be9..d5f9a2d1da1b 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -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); @@ -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; -- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html