From: Jarek Poplawski Date: Wed, 13 Aug 2008 22:16:43 +0000 (-0700) Subject: pkt_sched: Fix oops in htb_delete. X-Git-Tag: v3.12-rc1~18689^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26b284de54a5ca3dfbe2fd9a51ac1923e80085a2;p=kernel%2Fkernel-generic.git pkt_sched: Fix oops in htb_delete. Recent changes introduced a bug in htb_delete(): cl->parent->children counter update misses checking cl->parent for NULL, which is used for root classes, so deleting them causes an oops. Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index be35422..6febd24 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1279,7 +1279,8 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg) /* delete from hash and active; remainder in destroy_class */ qdisc_class_hash_remove(&q->clhash, &cl->common); - cl->parent->children--; + if (cl->parent) + cl->parent->children--; if (cl->prio_activity) htb_deactivate(q, cl);