From: Vasily Averin Date: Fri, 10 Apr 2020 21:34:10 +0000 (-0700) Subject: kernel/gcov/fs.c: gcov_seq_next() should increase position index X-Git-Tag: v5.10.7~2814^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4d74ef6220c1eda0875da30457bef5c7111ab06;p=platform%2Fkernel%2Flinux-rpi.git kernel/gcov/fs.c: gcov_seq_next() should increase position index If seq_file .next function does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: Andrew Morton Acked-by: Peter Oberparleiter Cc: Al Viro Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Manfred Spraul Cc: NeilBrown Cc: Steven Rostedt Cc: Waiman Long Link: http://lkml.kernel.org/r/f65c6ee7-bd00-f910-2f8a-37cc67e4ff88@virtuozzo.com Signed-off-by: Linus Torvalds --- diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c index 5e891c3..82babf5 100644 --- a/kernel/gcov/fs.c +++ b/kernel/gcov/fs.c @@ -108,9 +108,9 @@ static void *gcov_seq_next(struct seq_file *seq, void *data, loff_t *pos) { struct gcov_iterator *iter = data; + (*pos)++; if (gcov_iter_next(iter)) return NULL; - (*pos)++; return iter; }