Skip to content

Commit 107df03

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix memory leak in nftables, from Liping Zhang. 2) Need to check result of vlan_insert_tag() in batman-adv otherwise we risk NULL skb derefs, from Sven Eckelmann. 3) Check for dev_alloc_skb() failures in cfg80211, from Gregory Greenman. 4) Handle properly when we have ppp_unregister_channel() happening in parallel with ppp_connect_channel(), from WANG Cong. 5) Fix DCCP deadlock, from Eric Dumazet. 6) Bail out properly in UDP if sk_filter() truncates the packet to be smaller than even the space that the protocol headers need. From Michal Kubecek. 7) Similarly for rose, dccp, and sctp, from Willem de Bruijn. 8) Make TCP challenge ACKs less predictable, from Eric Dumazet. 9) Fix infinite loop in bgmac_dma_tx_add() from Florian Fainelli. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits) packet: propagate sock_cmsg_send() error net/mlx5e: Fix del vxlan port command buffer memset packet: fix second argument of sock_tx_timestamp() net: switchdev: change ageing_time type to clock_t Update maintainer for EHEA driver. net/mlx4_en: Add resilience in low memory systems net/mlx4_en: Move filters cleanup to a proper location sctp: load transport header after sk_filter net/sched/sch_htb: clamp xstats tokens to fit into 32-bit int net: cavium: liquidio: Avoid dma_unmap_single on uninitialized ndata net: nb8800: Fix SKB leak in nb8800_receive() et131x: Fix logical vs bitwise check in et131x_tx_timeout() vlan: use a valid default mtu value for vlan over macsec net: bgmac: Fix infinite loop in bgmac_dma_tx_add() mlxsw: spectrum: Prevent invalid ingress buffer mapping mlxsw: spectrum: Prevent overwrite of DCB capability fields mlxsw: spectrum: Don't emit errors when PFC is disabled mlxsw: spectrum: Indicate support for autonegotiation mlxsw: spectrum: Force link training according to admin state r8152: add MODULE_VERSION ...
2 parents 88083e9 + f8e7718 commit 107df03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+850
-320
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4476,7 +4476,7 @@ S: Orphan
44764476
F: fs/efs/
44774477

44784478
EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER
4479-
M: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
4479+
M: Douglas Miller <dougmill@linux.vnet.ibm.com>
44804480
44814481
S: Maintained
44824482
F: drivers/net/ethernet/ibm/ehea/

drivers/net/bonding/bond_netlink.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev,
446446
if (err < 0)
447447
return err;
448448

449-
return register_netdevice(bond_dev);
449+
err = register_netdevice(bond_dev);
450+
451+
netif_carrier_off(bond_dev);
452+
453+
return err;
450454
}
451455

452456
static size_t bond_get_size(const struct net_device *bond_dev)

drivers/net/ethernet/agere/et131x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3851,7 +3851,7 @@ static void et131x_tx_timeout(struct net_device *netdev)
38513851
unsigned long flags;
38523852

38533853
/* If the device is closed, ignore the timeout */
3854-
if (~(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE))
3854+
if (!(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE))
38553855
return;
38563856

38573857
/* Any nonrecoverable hardware error?

drivers/net/ethernet/aurora/nb8800.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ static void nb8800_receive(struct net_device *dev, unsigned int i,
259259
if (err) {
260260
netdev_err(dev, "rx buffer allocation failed\n");
261261
dev->stats.rx_dropped++;
262+
dev_kfree_skb(skb);
262263
return;
263264
}
264265

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac,
231231
dma_unmap_single(dma_dev, slot->dma_addr, skb_headlen(skb),
232232
DMA_TO_DEVICE);
233233

234-
while (i > 0) {
234+
while (i-- > 0) {
235235
int index = (ring->end + i) % BGMAC_TX_RING_SLOTS;
236236
struct bgmac_slot_info *slot = &ring->slots[index];
237237
u32 ctl1 = le32_to_cpu(ring->cpu_base[index].ctl1);

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
15911591
{
15921592
struct bnxt *bp = netdev_priv(dev);
15931593
u16 start = eeprom->offset, length = eeprom->len;
1594-
int rc;
1594+
int rc = 0;
15951595

15961596
memset(data, 0, eeprom->len);
15971597

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2821,7 +2821,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
28212821
if (!g) {
28222822
netif_info(lio, tx_err, lio->netdev,
28232823
"Transmit scatter gather: glist null!\n");
2824-
goto lio_xmit_failed;
2824+
goto lio_xmit_dma_failed;
28252825
}
28262826

28272827
cmdsetup.s.gather = 1;
@@ -2892,7 +2892,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
28922892
else
28932893
status = octnet_send_nic_data_pkt(oct, &ndata, xmit_more);
28942894
if (status == IQ_SEND_FAILED)
2895-
goto lio_xmit_failed;
2895+
goto lio_xmit_dma_failed;
28962896

28972897
netif_info(lio, tx_queued, lio->netdev, "Transmit queued successfully\n");
28982898

@@ -2906,12 +2906,13 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
29062906

29072907
return NETDEV_TX_OK;
29082908

2909+
lio_xmit_dma_failed:
2910+
dma_unmap_single(&oct->pci_dev->dev, ndata.cmd.dptr,
2911+
ndata.datasize, DMA_TO_DEVICE);
29092912
lio_xmit_failed:
29102913
stats->tx_dropped++;
29112914
netif_info(lio, tx_err, lio->netdev, "IQ%d Transmit dropped:%llu\n",
29122915
iq_no, stats->tx_dropped);
2913-
dma_unmap_single(&oct->pci_dev->dev, ndata.cmd.dptr,
2914-
ndata.datasize, DMA_TO_DEVICE);
29152916
recv_buffer_free(skb);
29162917
return NETDEV_TX_OK;
29172918
}

drivers/net/ethernet/ethoc.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,11 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev)
860860
unsigned int entry;
861861
void *dest;
862862

863+
if (skb_put_padto(skb, ETHOC_ZLEN)) {
864+
dev->stats.tx_errors++;
865+
goto out_no_free;
866+
}
867+
863868
if (unlikely(skb->len > ETHOC_BUFSIZ)) {
864869
dev->stats.tx_errors++;
865870
goto out;
@@ -894,6 +899,7 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev)
894899
skb_tx_timestamp(skb);
895900
out:
896901
dev_kfree_skb(skb);
902+
out_no_free:
897903
return NETDEV_TX_OK;
898904
}
899905

@@ -1086,7 +1092,7 @@ static int ethoc_probe(struct platform_device *pdev)
10861092
if (!priv->iobase) {
10871093
dev_err(&pdev->dev, "cannot remap I/O memory space\n");
10881094
ret = -ENXIO;
1089-
goto error;
1095+
goto free;
10901096
}
10911097

10921098
if (netdev->mem_end) {
@@ -1095,7 +1101,7 @@ static int ethoc_probe(struct platform_device *pdev)
10951101
if (!priv->membase) {
10961102
dev_err(&pdev->dev, "cannot remap memory space\n");
10971103
ret = -ENXIO;
1098-
goto error;
1104+
goto free;
10991105
}
11001106
} else {
11011107
/* Allocate buffer memory */
@@ -1106,7 +1112,7 @@ static int ethoc_probe(struct platform_device *pdev)
11061112
dev_err(&pdev->dev, "cannot allocate %dB buffer\n",
11071113
buffer_size);
11081114
ret = -ENOMEM;
1109-
goto error;
1115+
goto free;
11101116
}
11111117
netdev->mem_end = netdev->mem_start + buffer_size;
11121118
priv->dma_alloc = buffer_size;
@@ -1120,7 +1126,7 @@ static int ethoc_probe(struct platform_device *pdev)
11201126
128, (netdev->mem_end - netdev->mem_start + 1) / ETHOC_BUFSIZ);
11211127
if (num_bd < 4) {
11221128
ret = -ENODEV;
1123-
goto error;
1129+
goto free;
11241130
}
11251131
priv->num_bd = num_bd;
11261132
/* num_tx must be a power of two */
@@ -1133,7 +1139,7 @@ static int ethoc_probe(struct platform_device *pdev)
11331139
priv->vma = devm_kzalloc(&pdev->dev, num_bd*sizeof(void *), GFP_KERNEL);
11341140
if (!priv->vma) {
11351141
ret = -ENOMEM;
1136-
goto error;
1142+
goto free;
11371143
}
11381144

11391145
/* Allow the platform setup code to pass in a MAC address. */

drivers/net/ethernet/ezchip/nps_enet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static void nps_enet_hw_reset(struct net_device *ndev)
285285
ge_rst_value |= NPS_ENET_ENABLE << RST_GMAC_0_SHIFT;
286286
nps_enet_reg_set(priv, NPS_ENET_REG_GE_RST, ge_rst_value);
287287
usleep_range(10, 20);
288+
ge_rst_value = 0;
288289
nps_enet_reg_set(priv, NPS_ENET_REG_GE_RST, ge_rst_value);
289290

290291
/* Tx fifo reset sequence */

0 commit comments

Comments
 (0)