Commit feb0aa45 authored by Vasily Averin's avatar Vasily Averin Committed by Khalid Elmously

l2t_seq_next should increase position index

BugLink: https://bugs.launchpad.net/bugs/1864774

[ Upstream commit 66018a10 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 8309d357
...@@ -604,8 +604,7 @@ static void *l2t_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -604,8 +604,7 @@ static void *l2t_seq_start(struct seq_file *seq, loff_t *pos)
static void *l2t_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void *l2t_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ {
v = l2t_get_idx(seq, *pos); v = l2t_get_idx(seq, *pos);
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