Commit d24e8812 authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman

net: systemport: fix bcm_sysport_insert_tsb()

[ Upstream commit e87474a6 ]

Similar to commit bc23333b ("net:
bcmgenet: fix bcmgenet_put_tx_csum()"), we need to return the skb
pointer in case we had to reallocate the SKB headroom.

Fixes: 80105bef ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c02b2427
...@@ -757,7 +757,8 @@ static irqreturn_t bcm_sysport_tx_isr(int irq, void *dev_id) ...@@ -757,7 +757,8 @@ static irqreturn_t bcm_sysport_tx_isr(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
struct net_device *dev)
{ {
struct sk_buff *nskb; struct sk_buff *nskb;
struct bcm_tsb *tsb; struct bcm_tsb *tsb;
...@@ -773,7 +774,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) ...@@ -773,7 +774,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev)
if (!nskb) { if (!nskb) {
dev->stats.tx_errors++; dev->stats.tx_errors++;
dev->stats.tx_dropped++; dev->stats.tx_dropped++;
return -ENOMEM; return NULL;
} }
skb = nskb; skb = nskb;
} }
...@@ -792,7 +793,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) ...@@ -792,7 +793,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev)
ip_proto = ipv6_hdr(skb)->nexthdr; ip_proto = ipv6_hdr(skb)->nexthdr;
break; break;
default: default:
return 0; return skb;
} }
/* Get the checksum offset and the L4 (transport) offset */ /* Get the checksum offset and the L4 (transport) offset */
...@@ -810,7 +811,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) ...@@ -810,7 +811,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev)
tsb->l4_ptr_dest_map = csum_info; tsb->l4_ptr_dest_map = csum_info;
} }
return 0; return skb;
} }
static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
...@@ -844,8 +845,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, ...@@ -844,8 +845,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
/* Insert TSB and checksum infos */ /* Insert TSB and checksum infos */
if (priv->tsb_en) { if (priv->tsb_en) {
ret = bcm_sysport_insert_tsb(skb, dev); skb = bcm_sysport_insert_tsb(skb, dev);
if (ret) { if (!skb) {
ret = NETDEV_TX_OK; ret = NETDEV_TX_OK;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment