Commit 70a87287 authored by Vasily Averin's avatar Vasily Averin Committed by David S. Miller

seq_tab_next() should increase position index

if seq_file .next fuction does not change position index,
read after some lseek can generate unexpected output.

https://bugzilla.kernel.org/show_bug.cgi?id=206283Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2bec445f
...@@ -70,8 +70,7 @@ static void *seq_tab_start(struct seq_file *seq, loff_t *pos) ...@@ -70,8 +70,7 @@ static void *seq_tab_start(struct seq_file *seq, loff_t *pos)
static void *seq_tab_next(struct seq_file *seq, void *v, loff_t *pos) static void *seq_tab_next(struct seq_file *seq, void *v, loff_t *pos)
{ {
v = seq_tab_get_idx(seq->private, *pos + 1); v = seq_tab_get_idx(seq->private, *pos + 1);
if (v) ++(*pos);
++*pos;
return v; return v;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment