Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Pull networking fixes from David Miller:

 1) Fix several cases of missing of_node_put() calls in various
    networking drivers.  From Peter Chen.

 2) Don't try to remove unconfigured VLANs in qed driver, from Yuval
    Mintz.

 3) Unbalanced locking in TIPC error handling, from Wei Yongjun.

 4) Fix lockups in CPDMA driver, from Grygorii Strashko.

 5) More MACSEC refcount et al fixes, from Sabrina Dubroca.

 6) Fix MAC address setting in r8169 during runtime suspend, from
    Chun-Hao Lin.

 7) Various printf format specifier fixes, from Heinrich Schuchardt.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (59 commits)
  qed: Fail driver load in 100g MSI mode.
  ethernet: ti: davinci_emac: add missing of_node_put after calling of_parse_phandle
  ethernet: stmicro: stmmac: add missing of_node_put after calling of_parse_phandle
  ethernet: stmicro: stmmac: dwmac-socfpga: add missing of_node_put after calling of_parse_phandle
  ethernet: renesas: sh_eth: add missing of_node_put after calling of_parse_phandle
  ethernet: renesas: ravb_main: add missing of_node_put after calling of_parse_phandle
  ethernet: marvell: pxa168_eth: add missing of_node_put after calling of_parse_phandle
  ethernet: marvell: mvpp2: add missing of_node_put after calling of_parse_phandle
  ethernet: marvell: mvneta: add missing of_node_put after calling of_parse_phandle
  ethernet: hisilicon: hns: hns_dsaf_main: add missing of_node_put after calling of_parse_phandle
  ethernet: hisilicon: hns: hns_dsaf_mac: add missing of_node_put after calling of_parse_phandle
  ethernet: cavium: octeon: add missing of_node_put after calling of_parse_phandle
  ethernet: aurora: nb8800: add missing of_node_put after calling of_parse_phandle
  ethernet: arc: emac_main: add missing of_node_put after calling of_parse_phandle
  ethernet: apm: xgene: add missing of_node_put after calling of_parse_phandle
  ethernet: altera: add missing of_node_put
  8139too: fix system hang when there is a tx timeout event.
  qed: Fix error return code in qed_resc_alloc()
  net: qlcnic: avoid superfluous assignement
  dsa: b53: remove redundant if
  ...
  • Loading branch information
torvalds committed Aug 3, 2016
2 parents d52bd54 + 1d2c202 commit f093615
Show file tree
Hide file tree
Showing 52 changed files with 195 additions and 95 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
int err;

switch (event) {
case BUS_NOTIFY_DEL_DEVICE:
case BUS_NOTIFY_REMOVED_DEVICE:
if (pdev->archdata.od)
omap_device_delete(pdev->archdata.od);
break;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/caif/caif_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ static ssize_t print_frame(char *buf, size_t size, char *frm,
/* Fast forward. */
i = count - cut;
len += snprintf((buf + len), (size - len),
"--- %u bytes skipped ---\n",
(int)(count - (cut * 2)));
"--- %zu bytes skipped ---\n",
count - (cut * 2));
}

if ((!(i % 10)) && i) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/dsa/b53/b53_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ static int b53_mmap_probe(struct platform_device *pdev)
if (!dev)
return -ENOMEM;

if (pdata)
dev->pdata = pdata;
dev->pdata = pdata;

platform_set_drvdata(pdev, dev);

Expand Down
5 changes: 3 additions & 2 deletions drivers/net/dsa/bcm_sf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
"switch_0", priv);
if (ret < 0) {
pr_err("failed to request switch_0 IRQ\n");
goto out_unmap;
goto out_mdio;
}

ret = request_irq(priv->irq1, bcm_sf2_switch_1_isr, 0,
Expand Down Expand Up @@ -1679,14 +1679,15 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)

out_free_irq0:
free_irq(priv->irq0, priv);
out_mdio:
bcm_sf2_mdio_unregister(priv);
out_unmap:
base = &priv->core;
for (i = 0; i < BCM_SF2_REGS_NUM; i++) {
if (*base)
iounmap(*base);
base++;
}
bcm_sf2_mdio_unregister(priv);
return ret;
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/8390/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,8 @@ static int ax_probe(struct platform_device *pdev)
iounmap(ax->map2);

exit_mem2:
release_mem_region(mem2->start, mem2_size);
if (mem2)
release_mem_region(mem2->start, mem2_size);

exit_mem1:
iounmap(ei_local->mem);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/altera/altera_tse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ static int init_phy(struct net_device *dev)
phydev = of_phy_connect(dev, phynode,
&altera_tse_adjust_link, 0, priv->phy_iface);
}
of_node_put(phynode);

if (!phydev) {
netdev_err(dev, "Could not find the PHY\n");
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/amd/xgbe/xgbe-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static int xgbe_alloc_channels(struct xgbe_prv_data *pdata)
goto err_rx_ring;

for (i = 0, channel = channel_mem; i < count; i++, channel++) {
snprintf(channel->name, sizeof(channel->name), "channel-%d", i);
snprintf(channel->name, sizeof(channel->name), "channel-%u", i);
channel->pdata = pdata;
channel->queue_index = i;
channel->dma_regs = pdata->xgmac_regs + DMA_CH_BASE +
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ int xgene_enet_phy_connect(struct net_device *ndev)

phy_dev = of_phy_connect(ndev, np, &xgene_enet_adjust_link,
0, pdata->phy_mode);
of_node_put(np);
if (!phy_dev) {
netdev_err(ndev, "Could not connect to PHY\n");
return -ENODEV;
Expand Down
15 changes: 11 additions & 4 deletions drivers/net/ethernet/arc/emac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,14 +749,16 @@ int arc_emac_probe(struct net_device *ndev, int interface)
err = of_address_to_resource(dev->of_node, 0, &res_regs);
if (err) {
dev_err(dev, "failed to retrieve registers base from device tree\n");
return -ENODEV;
err = -ENODEV;
goto out_put_node;
}

/* Get IRQ from device tree */
irq = irq_of_parse_and_map(dev->of_node, 0);
if (!irq) {
dev_err(dev, "failed to retrieve <irq> value from device tree\n");
return -ENODEV;
err = -ENODEV;
goto out_put_node;
}

ndev->netdev_ops = &arc_emac_netdev_ops;
Expand All @@ -778,7 +780,7 @@ int arc_emac_probe(struct net_device *ndev, int interface)
err = clk_prepare_enable(priv->clk);
if (err) {
dev_err(dev, "failed to enable clock\n");
return err;
goto out_put_node;
}

clock_frequency = clk_get_rate(priv->clk);
Expand All @@ -787,7 +789,8 @@ int arc_emac_probe(struct net_device *ndev, int interface)
if (of_property_read_u32(dev->of_node, "clock-frequency",
&clock_frequency)) {
dev_err(dev, "failed to retrieve <clock-frequency> from device tree\n");
return -EINVAL;
err = -EINVAL;
goto out_put_node;
}
}

Expand Down Expand Up @@ -867,6 +870,7 @@ int arc_emac_probe(struct net_device *ndev, int interface)
goto out_netif_api;
}

of_node_put(phy_node);
return 0;

out_netif_api:
Expand All @@ -877,6 +881,9 @@ int arc_emac_probe(struct net_device *ndev, int interface)
out_clken:
if (priv->clk)
clk_disable_unprepare(priv->clk);
out_put_node:
of_node_put(phy_node);

return err;
}
EXPORT_SYMBOL_GPL(arc_emac_probe);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/aurora/nb8800.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,7 @@ static int nb8800_probe(struct platform_device *pdev)
err_free_dma:
nb8800_dma_free(dev);
err_free_bus:
of_node_put(priv->phy_node);
mdiobus_unregister(bus);
err_disable_clk:
clk_disable_unprepare(priv->clk);
Expand All @@ -1519,6 +1520,7 @@ static int nb8800_remove(struct platform_device *pdev)
struct nb8800_priv *priv = netdev_priv(ndev);

unregister_netdev(ndev);
of_node_put(priv->phy_node);

mdiobus_unregister(priv->mii_bus);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bcm63xx_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
} else {

/* run platform code to initialize PHY device */
if (pd->mii_config &&
if (pd && pd->mii_config &&
pd->mii_config(dev, 1, bcm_enet_mdio_read_mii,
bcm_enet_mdio_write_mii)) {
dev_err(&pdev->dev, "unable to configure mdio bus\n");
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/brocade/bna/bnad_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,
struct bnad_debug_info *regrd_debug = file->private_data;
struct bnad *bnad = (struct bnad *)regrd_debug->i_private;
struct bfa_ioc *ioc = &bnad->bna.ioceth.ioc;
int addr, len, rc, i;
int rc, i;
u32 addr, len;
u32 *regbuf;
void __iomem *rb, *reg_addr;
unsigned long flags;
Expand Down Expand Up @@ -372,7 +373,8 @@ bnad_debugfs_write_regwr(struct file *file, const char __user *buf,
struct bnad_debug_info *debug = file->private_data;
struct bnad *bnad = (struct bnad *)debug->i_private;
struct bfa_ioc *ioc = &bnad->bna.ioceth.ioc;
int addr, val, rc;
int rc;
u32 addr, val;
void __iomem *reg_addr;
unsigned long flags;
void *kern_buf;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,15 +1513,18 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
return 0;

err:
of_node_put(p->phy_np);
free_netdev(netdev);
return result;
}

static int octeon_mgmt_remove(struct platform_device *pdev)
{
struct net_device *netdev = platform_get_drvdata(pdev);
struct octeon_mgmt *p = netdev_priv(netdev);

unregister_netdev(netdev);
of_node_put(p->phy_np);
free_netdev(netdev);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ out_free: dev_kfree_skb_any(skb);

/* Discard the packet if the length is greater than mtu */
max_pkt_len = ETH_HLEN + dev->mtu;
if (skb_vlan_tag_present(skb))
if (skb_vlan_tagged(skb))
max_pkt_len += VLAN_HLEN;
if (!skb_shinfo(skb)->gso_size && (unlikely(skb->len > max_pkt_len)))
goto out_free;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4vf/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)

/* Discard the packet if the length is greater than mtu */
max_pkt_len = ETH_HLEN + dev->mtu;
if (skb_vlan_tag_present(skb))
if (skb_vlan_tagged(skb))
max_pkt_len += VLAN_HLEN;
if (!skb_shinfo(skb)->gso_size && (unlikely(skb->len > max_pkt_len)))
goto out_free;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/cisco/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ static int enic_request_intr(struct enic *enic)
intr = enic_msix_rq_intr(enic, i);
snprintf(enic->msix[intr].devname,
sizeof(enic->msix[intr].devname),
"%.11s-rx-%d", netdev->name, i);
"%.11s-rx-%u", netdev->name, i);
enic->msix[intr].isr = enic_isr_msix;
enic->msix[intr].devid = &enic->napi[i];
}
Expand All @@ -1577,7 +1577,7 @@ static int enic_request_intr(struct enic *enic)
intr = enic_msix_wq_intr(enic, i);
snprintf(enic->msix[intr].devname,
sizeof(enic->msix[intr].devname),
"%.11s-tx-%d", netdev->name, i);
"%.11s-tx-%u", netdev->name, i);
enic->msix[intr].isr = enic_isr_msix;
enic->msix[intr].devid = &enic->napi[wq];
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/dec/tulip/de4x5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ de4x5_open(struct net_device *dev)

if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
lp->adapter_name, dev)) {
printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq);
printk("de4x5_open(): Requested IRQ%d is busy - attempting FAST/SHARE...", dev->irq);
if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
lp->adapter_name, dev)) {
printk("\n Cannot get IRQ- reconfigure your hardware.\n");
Expand Down
9 changes: 6 additions & 3 deletions drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
mac_cb->mac_id, np->name);
}
of_node_put(np);

return 0;
}
Expand All @@ -812,10 +813,12 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
mac_cb->mac_id, np->name);
}
of_node_put(np);

syscon = syscon_node_to_regmap(
of_parse_phandle(to_of_node(mac_cb->fw_port),
"serdes-syscon", 0));
np = of_parse_phandle(to_of_node(mac_cb->fw_port),
"serdes-syscon", 0);
syscon = syscon_node_to_regmap(np);
of_node_put(np);
if (IS_ERR_OR_NULL(syscon)) {
dev_err(mac_cb->dev, "serdes-syscon is needed!\n");
return -EINVAL;
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)
const char *mode_str;
struct regmap *syscon;
struct resource *res;
struct device_node *np = dsaf_dev->dev->of_node;
struct device_node *np = dsaf_dev->dev->of_node, *np_temp;
struct platform_device *pdev = to_platform_device(dsaf_dev->dev);

if (dev_of_node(dsaf_dev->dev)) {
Expand Down Expand Up @@ -102,8 +102,9 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)
dsaf_dev->dsaf_tc_mode = HRD_DSAF_4TC_MODE;

if (dev_of_node(dsaf_dev->dev)) {
syscon = syscon_node_to_regmap(
of_parse_phandle(np, "subctrl-syscon", 0));
np_temp = of_parse_phandle(np, "subctrl-syscon", 0);
syscon = syscon_node_to_regmap(np_temp);
of_node_put(np_temp);
if (IS_ERR_OR_NULL(syscon)) {
res = platform_get_resource(pdev, IORESOURCE_MEM,
res_idx++);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -4118,6 +4118,7 @@ static int mvneta_probe(struct platform_device *pdev)
pp->bm_priv = NULL;
}
}
of_node_put(bm_node);

err = mvneta_init(&pdev->dev, pp);
if (err < 0)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/marvell/mvpp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6234,6 +6234,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
err_free_irq:
irq_dispose_mapping(port->irq);
err_free_netdev:
of_node_put(phy_node);
free_netdev(dev);
return err;
}
Expand All @@ -6244,6 +6245,7 @@ static void mvpp2_port_remove(struct mvpp2_port *port)
int i;

unregister_netdev(port->dev);
of_node_put(port->phy_node);
free_percpu(port->pcpu);
free_percpu(port->stats);
for (i = 0; i < txq_number; i++)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/marvell/pxa168_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
}
of_property_read_u32(np, "reg", &pep->phy_addr);
pep->phy_intf = of_get_phy_mode(pdev->dev.of_node);
of_node_put(np);
}

/* Hardware supports only 3 ports */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/neterion/s2io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7412,7 +7412,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)

if ((rxdp->Control_1 & TCP_OR_UDP_FRAME) &&
((!ring_data->lro) ||
(ring_data->lro && (!(rxdp->Control_1 & RXD_FRAME_IP_FRAG)))) &&
(!(rxdp->Control_1 & RXD_FRAME_IP_FRAG))) &&
(dev->features & NETIF_F_RXCSUM)) {
l3_csum = RXD_GET_L3_CKSUM(rxdp->Control_1);
l4_csum = RXD_GET_L4_CKSUM(rxdp->Control_1);
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/ethernet/qlogic/qed/qed_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
DP_ERR(p_hwfn,
"Cannot allocate 0x%x EQ elements. The maximum of a u16 chain is 0x%x\n",
n_eqes, 0xFFFF);
rc = -EINVAL;
goto alloc_err;
}

Expand Down Expand Up @@ -888,7 +889,7 @@ static int qed_hw_init_pf(struct qed_hwfn *p_hwfn,

if (hw_mode & (1 << MODE_MF_SI)) {
u8 pf_id = 0;
u32 val;
u32 val = 0;

if (!qed_hw_init_first_eth(p_hwfn, p_ptt, &pf_id)) {
if (p_hwfn->rel_pf_id == pf_id) {
Expand Down Expand Up @@ -2539,7 +2540,7 @@ int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate)

rc = __qed_configure_vport_wfq(p_hwfn, p_ptt, vp_id, rate);

if (!rc) {
if (rc) {
qed_ptt_release(p_hwfn, p_ptt);
return rc;
}
Expand Down
Loading

0 comments on commit f093615

Please sign in to comment.