Commit 8cbe1d46 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd96535b
...@@ -179,6 +179,7 @@ int qdisc_restart(struct net_device *dev) ...@@ -179,6 +179,7 @@ int qdisc_restart(struct net_device *dev)
netif_schedule(dev); netif_schedule(dev);
return 1; return 1;
} }
BUG_ON((int) q->q.qlen < 0);
return q->q.qlen; return q->q.qlen;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment