[NET_SCHED]: sch_htb: fix oops in htb_qlen_notify htb_delete calls qdisc_tree_decrease_qlen after removing the class from the class hash. This makes the ->get operation in qdisc_tree_decrease_qlen fail, so it passes a NULL pointer to htb_qlen_notify, causing an oops. Signed-off-by: Patrick McHardy --- commit 866d03284bf4ae694c8c12c1742dde1c5c06eca7 tree e43ac244d44b2422f0acb92dc9a48a66f92c2792 parent 703071b5b93d88d5acb0edd5b9dd86c69ad970f2 author Patrick McHardy Tue, 27 Mar 2007 17:07:50 +0200 committer Patrick McHardy Tue, 27 Mar 2007 17:07:50 +0200 net/sched/sch_htb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 97cbb9a..3c3294d 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1380,15 +1380,15 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg) sch_tree_lock(sch); - /* delete from hash and active; remainder in destroy_class */ - hlist_del_init(&cl->hlist); - if (!cl->level) { qlen = cl->un.leaf.q->q.qlen; qdisc_reset(cl->un.leaf.q); qdisc_tree_decrease_qlen(cl->un.leaf.q, qlen); } + /* delete from hash and active; remainder in destroy_class */ + hlist_del_init(&cl->hlist); + if (cl->prio_activity) htb_deactivate(q, cl);