summaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_mtk.c
diff options
context:
space:
mode:
authorFlorian Fainelli2017-04-08 17:55:22 +0200
committerDavid S. Miller2017-04-08 22:49:36 +0200
commit16c5dcb13a371feae0e680e6518775b5335b37d8 (patch)
tree2dd0fe414dc67bcef0da6c4e2a19178650145fe3 /net/dsa/tag_mtk.c
parentnet: dsa: Do not check for NULL dst in tag parsers (diff)
downloadkernel-qcow2-linux-16c5dcb13a371feae0e680e6518775b5335b37d8.tar.gz
kernel-qcow2-linux-16c5dcb13a371feae0e680e6518775b5335b37d8.tar.xz
kernel-qcow2-linux-16c5dcb13a371feae0e680e6518775b5335b37d8.zip
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 <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_mtk.c')
-rw-r--r--net/dsa/tag_mtk.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
index 836c311a3c38..d0a477084870 100644
--- a/net/dsa/tag_mtk.c
+++ b/net/dsa/tag_mtk.c
@@ -55,10 +55,6 @@ static int mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
int port;
__be16 *phdr, hdr;
- skb = skb_unshare(skb, GFP_ATOMIC);
- if (!skb)
- goto out;
-
if (unlikely(!pskb_may_pull(skb, MTK_HDR_LEN)))
goto out_drop;
@@ -105,7 +101,6 @@ static int mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
out_drop:
kfree_skb(skb);
-out:
return 0;
}