Skip to content

Commit f4d74ef

Browse files
vaverintorvalds
authored andcommitted
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Peter Oberparleiter <[email protected]> Cc: Al Viro <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: NeilBrown <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Waiman Long <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3bfa7e1 commit f4d74ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/gcov/fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ static void *gcov_seq_next(struct seq_file *seq, void *data, loff_t *pos)
108108
{
109109
struct gcov_iterator *iter = data;
110110

111+
(*pos)++;
111112
if (gcov_iter_next(iter))
112113
return NULL;
113-
(*pos)++;
114114

115115
return iter;
116116
}

0 commit comments

Comments
 (0)