]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sched/sch_cbq.c
net_sched: reset pointers to tcf blocks in classful qdiscs' destructors
[karo-tx-linux.git] / net / sched / sch_cbq.c
index 481036f6b54e4730ee27fae6236277c64d3eaa1a..780db43300b16284192b24006b0ae8677adbe505 100644 (file)
@@ -1431,8 +1431,10 @@ static void cbq_destroy(struct Qdisc *sch)
         * be bound to classes which have been destroyed already. --TGR '04
         */
        for (h = 0; h < q->clhash.hashsize; h++) {
-               hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode)
+               hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) {
                        tcf_block_put(cl->block);
+                       cl->block = NULL;
+               }
        }
        for (h = 0; h < q->clhash.hashsize; h++) {
                hlist_for_each_entry_safe(cl, next, &q->clhash.hash[h],