Skip to contentSkip to conversation

pkt_sched: Fix oops in htb_delete.

PATCH Applied Jarek Poplawski 2 participants 2 messages Aug 13, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkt_sched: Fix oops in htb_delete.

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.

---

 net/sched/sch_htb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/sched/sch_htb.c +2 -1
index be35422..6febd24 100644
@@ -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);
maintainer Applied
#1 lore raw

From: Jarek Poplawski <[email protected]>
Date: Wed, 13 Aug 2008 22:13:00 +0200

Quoted 7 lines

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.

Applied, thanks Jarek.