diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-10-02 12:43:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-04 20:30:04 -0400 |
commit | e87474a6e697857df21cff0707a2472abceca8b3 (patch) | |
tree | c9872e881550b36863d96f590a63ad7cf10a9a99 /drivers/net/ethernet/broadcom/bcmsysport.c | |
parent | 3be07244b7337760a3269d56b2f4a63e72218648 (diff) |
net: systemport: fix bcm_sysport_insert_tsb()
Similar to commit bc23333ba11fb7f959b7e87e121122f5a0fbbca8 ("net:
bcmgenet: fix bcmgenet_put_tx_csum()"), we need to return the skb
pointer in case we had to reallocate the SKB headroom.
Fixes: 80105befdb4b8 ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcmsysport.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bcmsysport.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index d9b9170ed2fc..71068d7d930d 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
@@ -848,7 +848,8 @@ static irqreturn_t bcm_sysport_wol_isr(int irq, void *dev_id) | |||
848 | return IRQ_HANDLED; | 848 | return IRQ_HANDLED; |
849 | } | 849 | } |
850 | 850 | ||
851 | static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) | 851 | static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb, |
852 | struct net_device *dev) | ||
852 | { | 853 | { |
853 | struct sk_buff *nskb; | 854 | struct sk_buff *nskb; |
854 | struct bcm_tsb *tsb; | 855 | struct bcm_tsb *tsb; |
@@ -864,7 +865,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) | |||
864 | if (!nskb) { | 865 | if (!nskb) { |
865 | dev->stats.tx_errors++; | 866 | dev->stats.tx_errors++; |
866 | dev->stats.tx_dropped++; | 867 | dev->stats.tx_dropped++; |
867 | return -ENOMEM; | 868 | return NULL; |
868 | } | 869 | } |
869 | skb = nskb; | 870 | skb = nskb; |
870 | } | 871 | } |
@@ -883,7 +884,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) | |||
883 | ip_proto = ipv6_hdr(skb)->nexthdr; | 884 | ip_proto = ipv6_hdr(skb)->nexthdr; |
884 | break; | 885 | break; |
885 | default: | 886 | default: |
886 | return 0; | 887 | return skb; |
887 | } | 888 | } |
888 | 889 | ||
889 | /* Get the checksum offset and the L4 (transport) offset */ | 890 | /* Get the checksum offset and the L4 (transport) offset */ |
@@ -902,7 +903,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) | |||
902 | tsb->l4_ptr_dest_map = csum_info; | 903 | tsb->l4_ptr_dest_map = csum_info; |
903 | } | 904 | } |
904 | 905 | ||
905 | return 0; | 906 | return skb; |
906 | } | 907 | } |
907 | 908 | ||
908 | static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, | 909 | static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, |
@@ -936,8 +937,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, | |||
936 | 937 | ||
937 | /* Insert TSB and checksum infos */ | 938 | /* Insert TSB and checksum infos */ |
938 | if (priv->tsb_en) { | 939 | if (priv->tsb_en) { |
939 | ret = bcm_sysport_insert_tsb(skb, dev); | 940 | skb = bcm_sysport_insert_tsb(skb, dev); |
940 | if (ret) { | 941 | if (!skb) { |
941 | ret = NETDEV_TX_OK; | 942 | ret = NETDEV_TX_OK; |
942 | goto out; | 943 | goto out; |
943 | } | 944 | } |