Skip to content

Commit 868eefe

Browse files
mstsirkindavem330
authored andcommitted
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>
1 parent 70008aa commit 868eefe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/tun.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
416416

417417
/* Orphan the skb - required as we might hang on to it
418418
* for indefinite time. */
419+
if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
420+
goto drop;
419421
skb_orphan(skb);
420422

421423
/* Enqueue packet */

0 commit comments

Comments
 (0)