diff mbox

[net-next] net: gso_skb is now a list, needs a proper destructor

Message ID 1409701903.26422.26.camel@edumazet-glaptop2.roam.corp.google.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Sept. 2, 2014, 11:51 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

gso_skb can now be a list of skbs.

Qdisc destructors have to take care of it, or we can leak skbs.

Fixes: ce93718fb7cd ("net: Don't keep around original SKB when we software segment GSO frames.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/sched/sch_generic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Sept. 2, 2014, 10:06 p.m. UTC | #1
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 02 Sep 2014 16:51:43 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> gso_skb can now be a list of skbs.
> 
> Qdisc destructors have to take care of it, or we can leak skbs.
> 
> Fixes: ce93718fb7cd ("net: Don't keep around original SKB when we software segment GSO frames.")
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jesper Dangaard Brouer Sept. 3, 2014, 10:33 a.m. UTC | #2
On Tue, 02 Sep 2014 15:06:04 -0700 (PDT) David Miller <davem@davemloft.net> wrote:

> Applied, thanks Eric.

I didn't see this patch the git tree, when I posted a similar fix.
So, just ignore my similar patch.
diff mbox

Patch

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 5b261e91bdbd..19696ebe9ebc 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -621,7 +621,7 @@  void qdisc_reset(struct Qdisc *qdisc)
 		ops->reset(qdisc);
 
 	if (qdisc->gso_skb) {
-		kfree_skb(qdisc->gso_skb);
+		kfree_skb_list(qdisc->gso_skb);
 		qdisc->gso_skb = NULL;
 		qdisc->q.qlen = 0;
 	}
@@ -657,7 +657,7 @@  void qdisc_destroy(struct Qdisc *qdisc)
 	module_put(ops->owner);
 	dev_put(qdisc_dev(qdisc));
 
-	kfree_skb(qdisc->gso_skb);
+	kfree_skb_list(qdisc->gso_skb);
 	/*
 	 * gen_estimator est_timer() might access qdisc->q.lock,
 	 * wait a RCU grace period before freeing qdisc.