# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/08/22 14:30:32+02:00 kaber@coreworks.de # [PKT_SCHED]: Fix class leak in CBQ scheduler # # Signed-off-by: Patrick McHardy # # net/sched/sch_cbq.c # 2004/08/22 14:30:13+02:00 kaber@coreworks.de +8 -6 # [PKT_SCHED]: Fix class leak in CBQ scheduler # diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c 2004-08-22 14:33:59 +02:00 +++ b/net/sched/sch_cbq.c 2004-08-22 14:33:59 +02:00 @@ -1746,15 +1746,18 @@ } } -static void cbq_destroy_class(struct cbq_class *cl) +static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl) { + struct cbq_sched_data *q = qdisc_priv(sch); + cbq_destroy_filters(cl); qdisc_destroy(cl->q); qdisc_put_rtab(cl->R_tab); #ifdef CONFIG_NET_ESTIMATOR qdisc_kill_estimator(&cl->stats); #endif - kfree(cl); + if (cl != &q->link) + kfree(cl); } static void @@ -1777,8 +1780,7 @@ for (cl = q->classes[h]; cl; cl = next) { next = cl->next; - if (cl != &q->link) - cbq_destroy_class(cl); + cbq_destroy_class(sch, cl); } } @@ -1799,7 +1801,7 @@ spin_unlock_bh(&sch->dev->queue_lock); #endif - cbq_destroy_class(cl); + cbq_destroy_class(sch, cl); } } @@ -2035,7 +2037,7 @@ sch_tree_unlock(sch); if (--cl->refcnt == 0) - cbq_destroy_class(cl); + cbq_destroy_class(sch, cl); return 0; }