]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
net-sched: fix filter destruction in atm/hfsc qdisc destruction
authorPatrick McHardy <kaber@trash.net>
Wed, 2 Jul 2008 02:53:09 +0000 (19:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jul 2008 02:53:09 +0000 (19:53 -0700)
Filters need to be destroyed before beginning to destroy classes
since the destination class needs to still be alive to unbind the
filter.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_atm.c
net/sched/sch_hfsc.c

index 8e5f70ba3a158b8744bf9396f515c76fd381e91c..db0e23ae85f8fb048c81e654ecbe8524fbf08f43 100644 (file)
@@ -586,9 +586,11 @@ static void atm_tc_destroy(struct Qdisc *sch)
        struct atm_flow_data *flow;
 
        pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p);
+       for (flow = p->flows; flow; flow = flow->next)
+               tcf_destroy_chain(&flow->filter_list);
+
        /* races ? */
        while ((flow = p->flows)) {
-               tcf_destroy_chain(&flow->filter_list);
                if (flow->ref > 1)
                        printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow,
                               flow->ref);
index eca83a3be2936ec3994d3a3ec9b39ff70a135b8f..e817aa00441d4a7b5a647450405e202f485bdc88 100644 (file)
@@ -1540,6 +1540,10 @@ hfsc_destroy_qdisc(struct Qdisc *sch)
        struct hfsc_class *cl, *next;
        unsigned int i;
 
+       for (i = 0; i < HFSC_HSIZE; i++) {
+               list_for_each_entry(cl, &q->clhash[i], hlist)
+                       tcf_destroy_chain(&cl->filter_list);
+       }
        for (i = 0; i < HFSC_HSIZE; i++) {
                list_for_each_entry_safe(cl, next, &q->clhash[i], hlist)
                        hfsc_destroy_class(sch, cl);