pkt_sched: sch_generic: Kfree gso_skb in qdisc_reset()
authorJarek Poplawski <jarkao2@gmail.com>
Mon, 3 Nov 2008 10:52:50 +0000 (02:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Nov 2008 10:52:50 +0000 (02:52 -0800)
Since gso_skb is re-used for qdisc_peek_dequeued(), and this skb is
counted in the qdisc->q.qlen, it has to be kfreed during qdisc_reset()
when qlen is zeroed.

With help from David S. Miller <davem@davemloft.net>

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c

index 318c9f656e8e0a41aed5e6c7cd0841fce88e7a5b..1192da2298358c9189cd37272f2ed32bf376c12a 100644 (file)
@@ -542,6 +542,9 @@ void qdisc_reset(struct Qdisc *qdisc)
 
        if (ops->reset)
                ops->reset(qdisc);
+
+       kfree_skb(qdisc->gso_skb);
+       qdisc->gso_skb = NULL;
 }
 EXPORT_SYMBOL(qdisc_reset);