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-Url: https://git.stricted.de/?a=commitdiff_plain;h=8cbe1d46d69f9e2c49f284fe0e9aee3387bd2c71;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 9a2f8e41a26e..87e48a4e1051 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; }