summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2020-01-23 10:11:13 +0300
committerDavid S. Miller <davem@davemloft.net>2020-01-24 11:42:18 +0100
commit66018a102f7756cf72db4d2704e1b93969d9d332 (patch)
tree777236fd3b1f23969ab0178ec63b5b4352765e17
parent70a87287c821e9721b62463777f55ba588ac4623 (diff)
l2t_seq_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=206283 Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/l2t.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
index e9e45006632d..1a16449e9deb 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -678,8 +678,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)
{
v = l2t_get_idx(seq, *pos);
- if (v)
- ++*pos;
+ ++(*pos);
return v;
}