]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/sched/sch_htb.c
net_sched: call qlen_notify only if child qdisc is empty
[mirror_ubuntu-bionic-kernel.git] / net / sched / sch_htb.c
index 203286ab442799a07808bd8f73af9f07b0482cbd..dcf3c85e1f4fad55b945e98089cc68bad17f0fa8 100644 (file)
@@ -1186,8 +1186,7 @@ static void htb_qlen_notify(struct Qdisc *sch, unsigned long arg)
 {
        struct htb_class *cl = (struct htb_class *)arg;
 
-       if (cl->un.leaf.q->q.qlen == 0)
-               htb_deactivate(qdisc_priv(sch), cl);
+       htb_deactivate(qdisc_priv(sch), cl);
 }
 
 static unsigned long htb_get(struct Qdisc *sch, u32 classid)
@@ -1258,8 +1257,10 @@ static void htb_destroy(struct Qdisc *sch)
        tcf_block_put(q->block);
 
        for (i = 0; i < q->clhash.hashsize; i++) {
-               hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode)
+               hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
                        tcf_block_put(cl->block);
+                       cl->block = NULL;
+               }
        }
        for (i = 0; i < q->clhash.hashsize; i++) {
                hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i],