net: sched: fix missing free per cpu on qstats
authorJohn Fastabend <[email protected]>
Tue, 5 Jan 2016 17:11:36 +0000 (09:11 -0800)
committerDavid S. Miller <[email protected]>
Wed, 6 Jan 2016 06:40:21 +0000 (01:40 -0500)
When a qdisc is using per cpu stats (currently just the ingress
qdisc) only the bstats are being freed. This also free's the qstats.

Fixes: b0ab6f92752b9f9d8 ("net: sched: enable per cpu qstats")
Signed-off-by: John Fastabend <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/sched/sch_generic.c

index e82a1ad80aa521291fba4e704bb3828e88a009db..16bc83b2842a74616cd58dd923a5981942321f3e 100644 (file)
@@ -658,8 +658,10 @@ static void qdisc_rcu_free(struct rcu_head *head)
 {
        struct Qdisc *qdisc = container_of(head, struct Qdisc, rcu_head);
 
-       if (qdisc_is_percpu_stats(qdisc))
+       if (qdisc_is_percpu_stats(qdisc)) {
                free_percpu(qdisc->cpu_bstats);
+               free_percpu(qdisc->cpu_qstats);
+       }
 
        kfree((char *) qdisc - qdisc->padded);
 }