netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sunvnet: fix a memory leak in vnet_handle_offloads
@ 2014-12-19  5:19 roy.qing.li
  2014-12-19 17:39 ` David L Stevens
  2014-12-19 18:22 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: roy.qing.li @ 2014-12-19  5:19 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com>

when skb_gso_segment returns error, the original skb should be freed

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 drivers/net/ethernet/sun/sunvnet.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 45c408e..d2835bf 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -1201,6 +1201,7 @@ static int vnet_handle_offloads(struct vnet_port *port, struct sk_buff *skb)
 		segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO);
 	if (IS_ERR(segs)) {
 		dev->stats.tx_dropped++;
+		dev_kfree_skb_any(skb);
 		return NETDEV_TX_OK;
 	}
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-19 18:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19  5:19 [PATCH] sunvnet: fix a memory leak in vnet_handle_offloads roy.qing.li
2014-12-19 17:39 ` David L Stevens
2014-12-19 18:22 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).