Commit a4aebb83 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

net-sched: fix filter destruction in atm/hfsc qdisc destruction

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ff31ab56
...@@ -586,9 +586,11 @@ static void atm_tc_destroy(struct Qdisc *sch) ...@@ -586,9 +586,11 @@ static void atm_tc_destroy(struct Qdisc *sch)
struct atm_flow_data *flow; struct atm_flow_data *flow;
pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p); 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 ? */ /* races ? */
while ((flow = p->flows)) { while ((flow = p->flows)) {
tcf_destroy_chain(&flow->filter_list);
if (flow->ref > 1) if (flow->ref > 1)
printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow, printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow,
flow->ref); flow->ref);
......
...@@ -1540,6 +1540,10 @@ hfsc_destroy_qdisc(struct Qdisc *sch) ...@@ -1540,6 +1540,10 @@ hfsc_destroy_qdisc(struct Qdisc *sch)
struct hfsc_class *cl, *next; struct hfsc_class *cl, *next;
unsigned int i; 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++) { for (i = 0; i < HFSC_HSIZE; i++) {
list_for_each_entry_safe(cl, next, &q->clhash[i], hlist) list_for_each_entry_safe(cl, next, &q->clhash[i], hlist)
hfsc_destroy_class(sch, cl); hfsc_destroy_class(sch, cl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment