aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-08-13 18:16:43 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-13 18:16:43 -0400
commit26b284de54a5ca3dfbe2fd9a51ac1923e80085a2 (patch)
tree949d06bd4dca0b43cb7247c2013c89337a8ca18b /net
parent64c00d81b5c2491bd140b3c8eb2e8c351513f971 (diff)
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 <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_htb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index be35422711a3..6febd245e62b 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)
1279 1279
1280 /* delete from hash and active; remainder in destroy_class */ 1280 /* delete from hash and active; remainder in destroy_class */
1281 qdisc_class_hash_remove(&q->clhash, &cl->common); 1281 qdisc_class_hash_remove(&q->clhash, &cl->common);
1282 cl->parent->children--; 1282 if (cl->parent)
1283 cl->parent->children--;
1283 1284
1284 if (cl->prio_activity) 1285 if (cl->prio_activity)
1285 htb_deactivate(q, cl); 1286 htb_deactivate(q, cl);