From 16c5dcb13a371feae0e680e6518775b5335b37d8 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 8 Apr 2017 08:55:22 -0700 Subject: net: dsa: Move skb_unshare() to dsa_switch_rcv() All DSA tag receive functions need to unshare the skb before mangling it, move this to the generic dsa_switch_rcv() function which will allow us to make the tag receive function return their mangled skb without caring about freeing a NULL skb. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller --- net/dsa/tag_edsa.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'net/dsa/tag_edsa.c') diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c index 30520ff9c9a2..b87009672b40 100644 --- a/net/dsa/tag_edsa.c +++ b/net/dsa/tag_edsa.c @@ -90,10 +90,6 @@ static int edsa_rcv(struct sk_buff *skb, struct net_device *dev, int source_device; int source_port; - skb = skb_unshare(skb, GFP_ATOMIC); - if (skb == NULL) - goto out; - if (unlikely(!pskb_may_pull(skb, EDSA_HLEN))) goto out_drop; @@ -194,7 +190,6 @@ static int edsa_rcv(struct sk_buff *skb, struct net_device *dev, out_drop: kfree_skb(skb); -out: return 0; } -- cgit