From: Stephen Hemminger Date: Tue, 3 May 2005 23:24:03 +0000 (-0700) Subject: [PKT_SCHED]: netetm: trap infinite loop hange on qlen underflow X-Git-Tag: v2.6.12-rc4~117^2~23^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cbe1d46d69f9e2c49f284fe0e9aee3387bd2c71;p=linux-2.6 [PKT_SCHED]: netetm: trap infinite loop hange on qlen underflow Due to bugs in netem (fixed by later patches), it is possible to get qdisc qlen to go negative. If this happens the CPU ends up spinning forever in qdisc_run(). So add a BUG_ON() to trap it. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 9a2f8e41a2..87e48a4e10 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -179,6 +179,7 @@ requeue: netif_schedule(dev); return 1; } + BUG_ON((int) q->q.qlen < 0); return q->q.qlen; }