sunvnet: fix a memory leak in vnet_handle_offloads
authorLi RongQing <roy.qing.li@gmail.com>
Fri, 19 Dec 2014 05:19:35 +0000 (13:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Dec 2014 18:19:45 +0000 (13:19 -0500)
when skb_gso_segment returns error, the original skb should be freed

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: David L Stevens <david.stevens@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/sunvnet.c

index 45c408ef67d0d904e08732c6c2b4f119a8b98ddd..d2835bf7b4fbef1744bf2bd6d840acfe47863a39 100644 (file)
@@ -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;
        }