summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2020-01-23 10:11:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-05 13:03:46 +0000
commitc10c5bb8a8b32a18cb3a408b28350b17ec9cda4c (patch)
tree14657dca60d531a9d07ee881bfa09e1380a07edb
parent6ffe7ec419b5dc0c41d4862fd1fe436494a2523b (diff)
l2t_seq_next should increase position index
[ Upstream commit 66018a102f7756cf72db4d2704e1b93969d9d332 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-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 ac27898c6ab0..e7bdaad6ed0f 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -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)
{
v = l2t_get_idx(seq, *pos);
- if (v)
- ++*pos;
+ ++(*pos);
return v;
}