Skip to content

Commit

Permalink
pkt_sched: sch_generic: Kfree gso_skb in qdisc_reset()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Nov 3, 2008
1 parent 5799de0 commit 67305eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 67305eb

Please sign in to comment.