Commit 6f97532e authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

fm10k: fix memory leak

This was detected by Coverity.
The function skb_cow_head leaves skb alone on failure, so caller needs
to free.
Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 945fae44
......@@ -627,8 +627,10 @@ static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev)
/* verify the skb head is not shared */
err = skb_cow_head(skb, 0);
if (err)
if (err) {
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
/* locate vlan header */
vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment