diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-06-01 23:07:15 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-02 00:34:56 +0300 |
commit | fe47d563065c91cd30088d9b118b79d44905be6f (patch) | |
tree | a45ba1a54b080a3a71e4650f03d57ac3de3767e8 /net/dsa/tag_brcm.c | |
parent | 5470979585d81271d4338c2accfd5e71dafa4af6 (diff) |
net: dsa: factor skb freeing on xmit
As of a86d8becc3f0 ("net: dsa: Factor bottom tag receive functions"),
the rcv caller frees the original SKB in case or error.
Be symmetric with that and make the xmit caller do the same.
At the same time, fix the checkpatch NULL comparison check:
CHECK: Comparison to NULL could be written "!nskb"
#208: FILE: net/dsa/tag_trailer.c:35:
+ if (nskb == NULL)
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_brcm.c')
-rw-r--r-- | net/dsa/tag_brcm.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index 635ecb6781e4..c03860907f28 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -65,7 +65,7 @@ static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb, struct net_device *dev u8 *brcm_tag; if (skb_cow_head(skb, BRCM_TAG_LEN) < 0) - goto out_free; + return NULL; skb_push(skb, BRCM_TAG_LEN); @@ -86,10 +86,6 @@ static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb, struct net_device *dev brcm_tag[3] = (1 << p->dp->index) & BRCM_IG_DSTMAP1_MASK; return skb; - -out_free: - kfree_skb(skb); - return NULL; } static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev, |