summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorPatrick McHardy2007-06-06 01:06:59 +0200
committerDavid S. Miller2007-06-07 22:41:05 +0200
commitb00b4bf94edb42852d55619af453588b2de2dc5e (patch)
tree01f79f50daf04a1f73a5d93365307711907b3169 /net/sched/sch_cbq.c
parent[NET]: Avoid duplicate netlink notification when changing link state (diff)
downloadkernel-qcow2-linux-b00b4bf94edb42852d55619af453588b2de2dc5e.tar.gz
kernel-qcow2-linux-b00b4bf94edb42852d55619af453588b2de2dc5e.tar.xz
kernel-qcow2-linux-b00b4bf94edb42852d55619af453588b2de2dc5e.zip
[NET_SCHED]: Fix filter double free
cbq and atm destroy their filters twice when destroying inner classes during qdisc destruction. Reported-and-tested-by: Strobl Anton <a.strobl@aws-it.at> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index a294542cb8e4..ee2d5967d109 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1748,10 +1748,12 @@ cbq_destroy(struct Qdisc* sch)
* classes from root to leafs which means that filters can still
* be bound to classes which have been destroyed already. --TGR '04
*/
- for (h = 0; h < 16; h++)
- for (cl = q->classes[h]; cl; cl = cl->next)
+ for (h = 0; h < 16; h++) {
+ for (cl = q->classes[h]; cl; cl = cl->next) {
tcf_destroy_chain(cl->filter_list);
-
+ cl->filter_list = NULL;
+ }
+ }
for (h = 0; h < 16; h++) {
struct cbq_class *next;