浏览代码

tun: orphan frags on xmit

tun xmit is actually receive of the internal tun
socket. Orphan the frags same as we do for normal rx path.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael S. Tsirkin 13 年之前
父节点
当前提交
868eefeb17
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/net/tun.c

+ 2 - 0
drivers/net/tun.c

@@ -416,6 +416,8 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
 
 
 	/* Orphan the skb - required as we might hang on to it
 	/* Orphan the skb - required as we might hang on to it
 	 * for indefinite time. */
 	 * for indefinite time. */
+	if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
+		goto drop;
 	skb_orphan(skb);
 	skb_orphan(skb);
 
 
 	/* Enqueue packet */
 	/* Enqueue packet */