提交 6f97532e 编写于 作者: S stephen hemminger 提交者: 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: NStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册