aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index e916ba8caccf..52cd71a4a343 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2694,10 +2694,12 @@ struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device *dev)
struct sk_buff *segs;
segs = skb_gso_segment(skb, features);
- kfree_skb(skb);
- if (IS_ERR(segs))
+ if (IS_ERR(segs)) {
segs = NULL;
- skb = segs;
+ } else if (segs) {
+ consume_skb(skb);
+ skb = segs;
+ }
} else {
if (skb_needs_linearize(skb, features) &&
__skb_linearize(skb))