From: Eric Dumazet Date: Fri, 20 Oct 2023 20:00:53 +0000 (+0000) Subject: net_sched: sch_fq: fix off-by-one error in fq_dequeue() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=06e4dd18f86876bc29786d66165f781cd0265b7c;p=linux.git net_sched: sch_fq: fix off-by-one error in fq_dequeue() A last minute change went wrong. We need to look for a packet in all 3 bands, not only two. Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202310201422.a22b0999-oliver.sang@intel.com Signed-off-by: Eric Dumazet Cc: Soheil Hassas Yeganeh Cc: Dave Taht Cc: Toke Høiland-Jørgensen Tested-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231020200053.675951-1-edumazet@google.com Signed-off-by: Jakub Kicinski --- diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index 8eacdb54e72f4..f6fd0de293e58 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c @@ -651,7 +651,7 @@ static struct sk_buff *fq_dequeue(struct Qdisc *sch) begin: head = fq_pband_head_select(pband); if (!head) { - while (++retry < FQ_BANDS) { + while (++retry <= FQ_BANDS) { if (++q->band_nr == FQ_BANDS) q->band_nr = 0; pband = &q->band_flows[q->band_nr];