summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-08-13 22:16:43 (GMT)
committerDavid S. Miller <davem@davemloft.net>2008-08-13 22:16:43 (GMT)
commit26b284de54a5ca3dfbe2fd9a51ac1923e80085a2 (patch)
tree949d06bd4dca0b43cb7247c2013c89337a8ca18b
parent64c00d81b5c2491bd140b3c8eb2e8c351513f971 (diff)
downloadlinux-fsl-qoriq-26b284de54a5ca3dfbe2fd9a51ac1923e80085a2.tar.xz
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>
-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 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);