Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2016 11:26:11 +0000 (07:26 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2016 11:26:11 +0000 (07:26 -0400)
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
  ...

52 files changed:
arch/arm/mach-omap2/omap_device.c
drivers/net/caif/caif_spi.c
drivers/net/dsa/b53/b53_mmap.c
drivers/net/dsa/bcm_sf2.c
drivers/net/ethernet/8390/ax88796.c
drivers/net/ethernet/altera/altera_tse_main.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
drivers/net/ethernet/arc/emac_main.c
drivers/net/ethernet/aurora/nb8800.c
drivers/net/ethernet/broadcom/bcm63xx_enet.c
drivers/net/ethernet/brocade/bna/bnad_debugfs.c
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
drivers/net/ethernet/chelsio/cxgb4/sge.c
drivers/net/ethernet/chelsio/cxgb4vf/sge.c
drivers/net/ethernet/cisco/enic/enic_main.c
drivers/net/ethernet/dec/tulip/de4x5.c
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/marvell/mvpp2.c
drivers/net/ethernet/marvell/pxa168_eth.c
drivers/net/ethernet/neterion/s2io.c
drivers/net/ethernet/qlogic/qed/qed_dev.c
drivers/net/ethernet/qlogic/qed/qed_l2.c
drivers/net/ethernet/qlogic/qed/qed_main.c
drivers/net/ethernet/qlogic/qed/qed_sriov.c
drivers/net/ethernet/qlogic/qed/qed_vf.c
drivers/net/ethernet/qlogic/qede/qede_main.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
drivers/net/ethernet/qlogic/qlge/qlge_main.c
drivers/net/ethernet/realtek/8139too.c
drivers/net/ethernet/realtek/r8169.c
drivers/net/ethernet/renesas/ravb_main.c
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/davinci_cpdma.c
drivers/net/ethernet/ti/davinci_emac.c
drivers/net/macsec.c
drivers/net/phy/mdio-xgene.c
drivers/net/phy/micrel.c
drivers/net/wan/fsl_ucc_hdlc.c
include/net/sctp/constants.h
net/ipv4/tcp_output.c
net/ipv6/addrconf.c
net/sctp/output.c
net/sctp/socket.c
net/sctp/ulpqueue.c
net/tipc/monitor.c

index c2626f83e0c22542f6fc1aaeffde238d02940584..e920dd83e443753ccced325ce19c48c6bca398c6 100644 (file)
@@ -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;
index 4721948a92f6a1db9cea13d66810041be5ec88e4..3a529fbe539fb6ee098f0b85515a49bdc1b64d90 100644 (file)
@@ -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) {
index 21f1068b080414e5ba0206cfa7f2439ac1c933a8..77ffc431280855adee1604668ab84ebd9bb07a76 100644 (file)
@@ -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);
 
index cd1d630ae3a9e4bd6e6ca5098480e46aa1b347ac..b2b838724a9b8608ac683a0925a30266f216cdef 100644 (file)
@@ -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,
@@ -1679,6 +1679,8 @@ 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++) {
@@ -1686,7 +1688,6 @@ out_unmap:
                        iounmap(*base);
                base++;
        }
-       bcm_sf2_mdio_unregister(priv);
        return ret;
 }
 
index 5698f5354c0bbd5b27061635757c894d315f8a65..39ca9350d1b22d0d153f377e86a41212fa12d380 100644 (file)
@@ -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);
index 49025e99fb0e0919d5a4374e8ec4fe4d3e77d89c..bda31f308cc2a0b028273298345b5d43b03908b6 100644 (file)
@@ -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");
index ebf9224b2d312fa1ecc4d43434bde81d751c8df0..a9b2709567ec34c91a3416cefcd43335330e20eb 100644 (file)
@@ -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 +
index 7714b7d4026af27709ee725aaae494608ead041f..37a0f463b8de5c9d0479b220ac2303fa895cc6ea 100644 (file)
@@ -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;
index 586bedac457d266a0a82eb2c2f61c8961e247ec2..4bff0f3040df7a85bae40278e13b655009ba1a49 100644 (file)
@@ -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;
@@ -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);
@@ -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;
                }
        }
 
@@ -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:
@@ -877,6 +881,9 @@ out_mdio:
 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);
index 0d4ea92a0d370691d178d111458c2783cc8156ac..b047fd607b83bc796684ceb945ccc715ebdb1c80 100644 (file)
@@ -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);
@@ -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);
 
index 87c6b5bdd6163d6aecb19bac0282a46cd0de4388..6c8bc5fadac7b33dc33dc248b6f0153661994269 100644 (file)
@@ -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");
index 8fc246ea1fb828c5cd2103145903dfd3a81d9cb4..05c1c1dd7751bd720fac026876c7fcf7392eca03 100644 (file)
@@ -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;
@@ -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;
index e8bc15bcde7096033ea697adf00dd74c1824437c..4ab404f45b215820245ed9f9ad478c7c3961d752 100644 (file)
@@ -1513,6 +1513,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
        return 0;
 
 err:
+       of_node_put(p->phy_np);
        free_netdev(netdev);
        return result;
 }
@@ -1520,8 +1521,10 @@ err:
 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;
 }
index bad253beb8c8671ede3531d7471dd6754651d178..ad3552df054576d14d9b3fc4cdf08f103a888756 100644 (file)
@@ -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;
index 1bb57d3fbbe8783e32187509081ea3a63991641e..c8fd4f8fe1fab58589576cfe12cec9210442b52d 100644 (file)
@@ -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;
index f15560a0671804df24c7ac2ae61cb6b9b3fd5f01..48f82ab6c25b19811c5088aab0ad37a62f4e922f 100644 (file)
@@ -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];
                }
@@ -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];
                }
index cbe84972ff7a644fb31f84b30a6cf09e12cae737..f0e9e2ef62a06e3e04a7c71516d2849c251397fa 100644 (file)
@@ -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");
index 3fb87e233c496f152e8709f37a97f06e5c464d2b..5c8afe1a5ccb1d35c0e545c92212e3b7c2428ac9 100644 (file)
@@ -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;
        }
@@ -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;
index 2ef4277d00b3167edc029f8ff5921048a5da8e1e..afb5daa3721d2162c3fe134c4716e551e0153ddd 100644 (file)
@@ -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)) {
@@ -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++);
index f92018b13d2869e57ec307029072e3b85ac5041a..d41c28d00b57fa16d2d01160f2168ef675a0e2e2 100644 (file)
@@ -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)
index 0b047178cda1107fc28bb55396d97ee7818b41fc..60227a3452a40d00014a2f7d5584f3b518785455 100644 (file)
@@ -6234,6 +6234,7 @@ err_free_stats:
 err_free_irq:
        irq_dispose_mapping(port->irq);
 err_free_netdev:
+       of_node_put(phy_node);
        free_netdev(dev);
        return err;
 }
@@ -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++)
index aeeb2e79a91a734f3083cc3c733af392f93b711d..5d5000c8edf1db72e179249cf4abf20011e3301f 100644 (file)
@@ -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 */
index 2874dffe77deaa88f3c70af0af744d232336bbab..eaa37c079a7cd740058b366c4c5e7855447bdc58 100644 (file)
@@ -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);
index b26fe267a150982d5a165f510dcb873457f61924..0e4f4a9306b55ac64173a7a1ce73ad0626e5a143 100644 (file)
@@ -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;
                }
 
@@ -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) {
@@ -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;
                }
index a12c6caa6c663cd1d30250e422eb780d63ec4a69..401e738543b5080a0fe1f394c19f18728c533c59 100644 (file)
@@ -590,7 +590,7 @@ qed_sp_eth_rx_queue_start(struct qed_hwfn *p_hwfn,
                          u16 cqe_pbl_size, void __iomem **pp_prod)
 {
        struct qed_hw_cid_data *p_rx_cid;
-       u64 init_prod_val = 0;
+       u32 init_prod_val = 0;
        u16 abs_l2_queue = 0;
        u8 abs_stats_id = 0;
        int rc;
@@ -618,7 +618,7 @@ qed_sp_eth_rx_queue_start(struct qed_hwfn *p_hwfn,
                                 MSTORM_ETH_PF_PRODS_OFFSET(abs_l2_queue);
 
        /* Init the rcq, rx bd and rx sge (if valid) producers to 0 */
-       __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u64),
+       __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u32),
                          (u32 *)(&init_prod_val));
 
        /* Allocate a CID for the queue */
@@ -1664,6 +1664,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
        info->num_tc = 1;
 
        if (IS_PF(cdev)) {
+               int max_vf_vlan_filters = 0;
+
                if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
                        for_each_hwfn(cdev, i)
                            info->num_queues +=
@@ -1676,7 +1678,12 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
                        info->num_queues = cdev->num_hwfns;
                }
 
-               info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN);
+               if (IS_QED_SRIOV(cdev))
+                       max_vf_vlan_filters = cdev->p_iov_info->total_vfs *
+                                             QED_ETH_VF_NUM_VLAN_FILTERS;
+               info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN) -
+                                        max_vf_vlan_filters;
+
                ether_addr_copy(info->port_mac,
                                cdev->hwfns[0].hw_info.hw_mac_addr);
        } else {
index 1f13abb5c31693f5be5b9a13fc44bba23e330159..c7dc34bfdd0a6fe347fca4ca721ad11dc7867a3c 100644 (file)
@@ -659,8 +659,13 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev,
        struct qed_sb_cnt_info sb_cnt_info;
        int rc;
        int i;
-       memset(&cdev->int_params, 0, sizeof(struct qed_int_params));
 
+       if ((int_mode == QED_INT_MODE_MSI) && (cdev->num_hwfns > 1)) {
+               DP_NOTICE(cdev, "MSI mode is not supported for CMT devices\n");
+               return -EINVAL;
+       }
+
+       memset(&cdev->int_params, 0, sizeof(struct qed_int_params));
        cdev->int_params.in.int_mode = int_mode;
        for_each_hwfn(cdev, i) {
                memset(&sb_cnt_info, 0, sizeof(sb_cnt_info));
index 4d161c751c1217a23bf5f0de666a81132e7c2151..15399da268d9652769f0fe76a715622e719c0aaa 100644 (file)
@@ -1404,7 +1404,7 @@ static int __qed_iov_spoofchk_set(struct qed_hwfn *p_hwfn,
        params.anti_spoofing_en = val;
 
        rc = qed_sp_vport_update(p_hwfn, &params, QED_SPQ_MODE_EBLOCK, NULL);
-       if (rc) {
+       if (!rc) {
                p_vf->spoof_chk = val;
                p_vf->req_spoofchk_val = p_vf->spoof_chk;
                DP_VERBOSE(p_hwfn, QED_MSG_IOV,
index 9819230947bfe9bdd602266b93ed6d4d91e17c13..9b780b31b15c84c92c754d58e9a7ebd7d6eead53 100644 (file)
@@ -388,7 +388,7 @@ int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
 
        /* Learn the address of the producer from the response */
        if (pp_prod) {
-               u64 init_prod_val = 0;
+               u32 init_prod_val = 0;
 
                *pp_prod = (u8 __iomem *)p_hwfn->regview + resp->offset;
                DP_VERBOSE(p_hwfn, QED_MSG_IOV,
@@ -396,7 +396,7 @@ int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
                           rx_qid, *pp_prod, resp->offset);
 
                /* Init the rcq, rx bd and rx sge (if valid) producers to 0 */
-               __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u64),
+               __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u32),
                                  (u32 *)&init_prod_val);
        }
 
index 91e7bb0b85c85f65661ff59cf12762b2b96b0592..e4bd02e46e577f41534ae176949ede1220728796 100644 (file)
@@ -2064,10 +2064,13 @@ static int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
        }
 
        /* Remove vlan */
-       rc = qede_set_ucast_rx_vlan(edev, QED_FILTER_XCAST_TYPE_DEL, vid);
-       if (rc) {
-               DP_ERR(edev, "Failed to remove VLAN %d\n", vid);
-               return -EINVAL;
+       if (vlan->configured) {
+               rc = qede_set_ucast_rx_vlan(edev, QED_FILTER_XCAST_TYPE_DEL,
+                                           vid);
+               if (rc) {
+                       DP_ERR(edev, "Failed to remove VLAN %d\n", vid);
+                       return -EINVAL;
+               }
        }
 
        qede_del_vlan_from_list(edev, vlan);
@@ -3268,6 +3271,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
        start.vport_id = 0;
        start.drop_ttl0 = true;
        start.remove_inner_vlan = vlan_removal_en;
+       start.clear_stats = clear_stats;
 
        rc = edev->ops->vport_start(cdev, &start);
 
index 9777e571352534e8060d2f023b5a8135e5aae2b9..f4aa6331b367b2913b34adbc4c1163c9d68abb16 100644 (file)
@@ -45,7 +45,6 @@ struct qlcnic_dcb {
 static inline void qlcnic_clear_dcb_ops(struct qlcnic_dcb *dcb)
 {
        kfree(dcb);
-       dcb = NULL;
 }
 
 static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb)
index fd5d1c93b55b7d8f31147b73d51aa562f5f0714f..fd4a8e473f11180b75bf7949845cdbcdd84486f6 100644 (file)
@@ -1892,7 +1892,6 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev,
                        skb->len += length;
                        skb->data_len += length;
                        skb->truesize += length;
-                       length -= length;
                        ql_update_mac_hdr_len(qdev, ib_mac_rsp,
                                              lbq_desc->p.pg_chunk.va,
                                              &hlen);
index ef668d300800c61b18dc97af10afe2f78d20f870..da4c2d8a4173f89ca8b18e8a81be7c053c0f48a5 100644 (file)
@@ -1667,6 +1667,10 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
        int i;
        u8 tmp8;
 
+       napi_disable(&tp->napi);
+       netif_stop_queue(dev);
+       synchronize_sched();
+
        netdev_dbg(dev, "Transmit timeout, status %02x %04x %04x media %02x\n",
                   RTL_R8(ChipCmd), RTL_R16(IntrStatus),
                   RTL_R16(IntrMask), RTL_R8(MediaStatus));
@@ -1696,10 +1700,10 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
        spin_unlock_irq(&tp->lock);
 
        /* ...and finally, reset everything */
-       if (netif_running(dev)) {
-               rtl8139_hw_start (dev);
-               netif_wake_queue (dev);
-       }
+       napi_enable(&tp->napi);
+       rtl8139_hw_start(dev);
+       netif_wake_queue(dev);
+
        spin_unlock_bh(&tp->rx_lock);
 }
 
index 0e62d74b09b376d62ec50f52373151a43290d86f..e55638c7505a787e501fbae2dbcb1751b92f5859 100644 (file)
@@ -1749,13 +1749,21 @@ static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
 static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
+       struct device *d = &tp->pci_dev->dev;
+
+       pm_runtime_get_noresume(d);
 
        rtl_lock_work(tp);
 
        wol->supported = WAKE_ANY;
-       wol->wolopts = __rtl8169_get_wol(tp);
+       if (pm_runtime_active(d))
+               wol->wolopts = __rtl8169_get_wol(tp);
+       else
+               wol->wolopts = tp->saved_wolopts;
 
        rtl_unlock_work(tp);
+
+       pm_runtime_put_noidle(d);
 }
 
 static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
@@ -1845,6 +1853,9 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
 static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
+       struct device *d = &tp->pci_dev->dev;
+
+       pm_runtime_get_noresume(d);
 
        rtl_lock_work(tp);
 
@@ -1852,12 +1863,17 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
                tp->features |= RTL_FEATURE_WOL;
        else
                tp->features &= ~RTL_FEATURE_WOL;
-       __rtl8169_set_wol(tp, wol->wolopts);
+       if (pm_runtime_active(d))
+               __rtl8169_set_wol(tp, wol->wolopts);
+       else
+               tp->saved_wolopts = wol->wolopts;
 
        rtl_unlock_work(tp);
 
        device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
 
+       pm_runtime_put_noidle(d);
+
        return 0;
 }
 
@@ -2292,11 +2308,17 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
                                      struct ethtool_stats *stats, u64 *data)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
+       struct device *d = &tp->pci_dev->dev;
        struct rtl8169_counters *counters = tp->counters;
 
        ASSERT_RTNL();
 
-       rtl8169_update_counters(dev);
+       pm_runtime_get_noresume(d);
+
+       if (pm_runtime_active(d))
+               rtl8169_update_counters(dev);
+
+       pm_runtime_put_noidle(d);
 
        data[0] = le64_to_cpu(counters->tx_packets);
        data[1] = le64_to_cpu(counters->rx_packets);
@@ -4458,6 +4480,7 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
 static int rtl_set_mac_address(struct net_device *dev, void *p)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
+       struct device *d = &tp->pci_dev->dev;
        struct sockaddr *addr = p;
 
        if (!is_valid_ether_addr(addr->sa_data))
@@ -4465,7 +4488,12 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
 
        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
-       rtl_rar_set(tp, dev->dev_addr);
+       pm_runtime_get_noresume(d);
+
+       if (pm_runtime_active(d))
+               rtl_rar_set(tp, dev->dev_addr);
+
+       pm_runtime_put_noidle(d);
 
        return 0;
 }
@@ -7868,6 +7896,7 @@ static int rtl8169_runtime_resume(struct device *device)
        struct pci_dev *pdev = to_pci_dev(device);
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rtl8169_private *tp = netdev_priv(dev);
+       rtl_rar_set(tp, dev->dev_addr);
 
        if (!tp->TxDescArray)
                return 0;
index 8377d0220fa892380a6ea2a72d053e1bc4eb73e6..1e1cc0fad17fc165917455d4eb733e0da8c6623f 100644 (file)
@@ -1005,6 +1005,7 @@ static int ravb_phy_init(struct net_device *ndev)
        }
        phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0,
                                priv->phy_interface);
+       of_node_put(pn);
        if (!phydev) {
                netdev_err(ndev, "failed to connect PHY\n");
                return -ENOENT;
index 7bd910ce8b346eec90433ae7c44b3719a0d14691..799d58d86e6dcb86fc23c125abbbbc317720e2b7 100644 (file)
@@ -1780,6 +1780,7 @@ static int sh_eth_phy_init(struct net_device *ndev)
                                        sh_eth_adjust_link, 0,
                                        mdp->phy_interface);
 
+               of_node_put(pn);
                if (!phydev)
                        phydev = ERR_PTR(-ENOENT);
        } else {
index edd20c3b2b3d538254f501e1b837ee39f846e9f8..bec6963ac71e978e8959fce41607e06ceb955518 100644 (file)
@@ -135,7 +135,9 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
 
        np_splitter = of_parse_phandle(np, "altr,emac-splitter", 0);
        if (np_splitter) {
-               if (of_address_to_resource(np_splitter, 0, &res_splitter)) {
+               ret = of_address_to_resource(np_splitter, 0, &res_splitter);
+               of_node_put(np_splitter);
+               if (ret) {
                        dev_info(dev, "Missing emac splitter address\n");
                        return -EINVAL;
                }
@@ -159,14 +161,17 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
                                dev_err(dev,
                                        "%s: ERROR: missing emac splitter address\n",
                                        __func__);
-                               return -EINVAL;
+                               ret = -EINVAL;
+                               goto err_node_put;
                        }
 
                        dwmac->splitter_base =
                            devm_ioremap_resource(dev, &res_splitter);
 
-                       if (IS_ERR(dwmac->splitter_base))
-                               return PTR_ERR(dwmac->splitter_base);
+                       if (IS_ERR(dwmac->splitter_base)) {
+                               ret = PTR_ERR(dwmac->splitter_base);
+                               goto err_node_put;
+                       }
                }
 
                index = of_property_match_string(np_sgmii_adapter, "reg-names",
@@ -178,14 +183,17 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
                                dev_err(dev,
                                        "%s: ERROR: failed mapping adapter\n",
                                        __func__);
-                               return -EINVAL;
+                               ret = -EINVAL;
+                               goto err_node_put;
                        }
 
                        dwmac->pcs.sgmii_adapter_base =
                            devm_ioremap_resource(dev, &res_sgmii_adapter);
 
-                       if (IS_ERR(dwmac->pcs.sgmii_adapter_base))
-                               return PTR_ERR(dwmac->pcs.sgmii_adapter_base);
+                       if (IS_ERR(dwmac->pcs.sgmii_adapter_base)) {
+                               ret = PTR_ERR(dwmac->pcs.sgmii_adapter_base);
+                               goto err_node_put;
+                       }
                }
 
                index = of_property_match_string(np_sgmii_adapter, "reg-names",
@@ -197,22 +205,30 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
                                dev_err(dev,
                                        "%s: ERROR: failed mapping tse control port\n",
                                        __func__);
-                               return -EINVAL;
+                               ret = -EINVAL;
+                               goto err_node_put;
                        }
 
                        dwmac->pcs.tse_pcs_base =
                            devm_ioremap_resource(dev, &res_tse_pcs);
 
-                       if (IS_ERR(dwmac->pcs.tse_pcs_base))
-                               return PTR_ERR(dwmac->pcs.tse_pcs_base);
+                       if (IS_ERR(dwmac->pcs.tse_pcs_base)) {
+                               ret = PTR_ERR(dwmac->pcs.tse_pcs_base);
+                               goto err_node_put;
+                       }
                }
        }
        dwmac->reg_offset = reg_offset;
        dwmac->reg_shift = reg_shift;
        dwmac->sys_mgr_base_addr = sys_mgr_base_addr;
        dwmac->dev = dev;
+       of_node_put(np_sgmii_adapter);
 
        return 0;
+
+err_node_put:
+       of_node_put(np_sgmii_adapter);
+       return ret;
 }
 
 static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
index c23ccabc2d8a91d591e97ccd49dcf1baf700fdec..4c8c60af798595e198a24951bf9547aa0de522dc 100644 (file)
@@ -3397,6 +3397,7 @@ int stmmac_dvr_remove(struct device *dev)
        stmmac_set_mac(priv->ioaddr, false);
        netif_carrier_off(ndev);
        unregister_netdev(ndev);
+       of_node_put(priv->plat->phy_node);
        if (priv->stmmac_rst)
                reset_control_assert(priv->stmmac_rst);
        clk_disable_unprepare(priv->pclk);
index f7dfc0ae8e9c52b32ae658a488e5f17718820966..756bb548e81a717c70f0b994d4054b33063742aa 100644 (file)
@@ -113,8 +113,10 @@ static struct stmmac_axi *stmmac_axi_setup(struct platform_device *pdev)
                return NULL;
 
        axi = kzalloc(sizeof(*axi), GFP_KERNEL);
-       if (!axi)
+       if (!axi) {
+               of_node_put(np);
                return ERR_PTR(-ENOMEM);
+       }
 
        axi->axi_lpi_en = of_property_read_bool(np, "snps,lpi_en");
        axi->axi_xit_frm = of_property_read_bool(np, "snps,xit_frm");
@@ -127,6 +129,7 @@ static struct stmmac_axi *stmmac_axi_setup(struct platform_device *pdev)
        of_property_read_u32(np, "snps,wr_osr_lmt", &axi->axi_wr_osr_lmt);
        of_property_read_u32(np, "snps,rd_osr_lmt", &axi->axi_rd_osr_lmt);
        of_property_read_u32_array(np, "snps,blen", axi->axi_blen, AXI_BLEN);
+       of_node_put(np);
 
        return axi;
 }
@@ -302,7 +305,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
                dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
                                       GFP_KERNEL);
                if (!dma_cfg) {
-                       of_node_put(np);
+                       of_node_put(plat->phy_node);
                        return ERR_PTR(-ENOMEM);
                }
                plat->dma_cfg = dma_cfg;
index 1a93a1f28433f128db36c10a3a15a7e3900c4182..c51f34693eae40440604c4090e23dcf6201cd21e 100644 (file)
@@ -2564,19 +2564,17 @@ clean_ndev_ret:
        return ret;
 }
 
-static int cpsw_remove_child_device(struct device *dev, void *c)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-
-       of_device_unregister(pdev);
-
-       return 0;
-}
-
 static int cpsw_remove(struct platform_device *pdev)
 {
        struct net_device *ndev = platform_get_drvdata(pdev);
        struct cpsw_priv *priv = netdev_priv(ndev);
+       int ret;
+
+       ret = pm_runtime_get_sync(&pdev->dev);
+       if (ret < 0) {
+               pm_runtime_put_noidle(&pdev->dev);
+               return ret;
+       }
 
        if (priv->data.dual_emac)
                unregister_netdev(cpsw_get_slave_ndev(priv, 1));
@@ -2584,8 +2582,9 @@ static int cpsw_remove(struct platform_device *pdev)
 
        cpsw_ale_destroy(priv->ale);
        cpdma_ctlr_destroy(priv->dma);
+       of_platform_depopulate(&pdev->dev);
+       pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
-       device_for_each_child(&pdev->dev, NULL, cpsw_remove_child_device);
        if (priv->data.dual_emac)
                free_netdev(cpsw_get_slave_ndev(priv, 1));
        free_netdev(ndev);
index 73638f7a55d45a454b2e1d1d1f919f9158c14a33..19e5f32a8a64cfcaebc98759a1c337b486da40ec 100644 (file)
@@ -357,13 +357,11 @@ EXPORT_SYMBOL_GPL(cpdma_ctlr_stop);
 
 int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)
 {
-       unsigned long flags;
        int ret = 0, i;
 
        if (!ctlr)
                return -EINVAL;
 
-       spin_lock_irqsave(&ctlr->lock, flags);
        if (ctlr->state != CPDMA_STATE_IDLE)
                cpdma_ctlr_stop(ctlr);
 
@@ -371,7 +369,6 @@ int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)
                cpdma_chan_destroy(ctlr->channels[i]);
 
        cpdma_desc_pool_destroy(ctlr->pool);
-       spin_unlock_irqrestore(&ctlr->lock, flags);
        return ret;
 }
 EXPORT_SYMBOL_GPL(cpdma_ctlr_destroy);
index 6e305a82ed43c135fca5903d405b7083b3c3e99d..727a79f3c7dd531c9e53710a4f270915fc3797dc 100644 (file)
@@ -1964,6 +1964,7 @@ static int davinci_emac_remove(struct platform_device *pdev)
        cpdma_ctlr_destroy(priv->dma);
 
        unregister_netdev(ndev);
+       of_node_put(priv->phy_node);
        pm_runtime_disable(&pdev->dev);
        free_netdev(ndev);
 
index 2d0beb1b801c0f0a3c27db7b1156c48697b0fdf4..d13e6e15d7b5e394dff13bee8a1238e6576658a7 100644 (file)
@@ -344,7 +344,6 @@ static void free_rxsa(struct rcu_head *head)
 
        crypto_free_aead(sa->key.tfm);
        free_percpu(sa->stats);
-       macsec_rxsc_put(sa->sc);
        kfree(sa);
 }
 
@@ -863,6 +862,7 @@ static void macsec_decrypt_done(struct crypto_async_request *base, int err)
        struct net_device *dev = skb->dev;
        struct macsec_dev *macsec = macsec_priv(dev);
        struct macsec_rx_sa *rx_sa = macsec_skb_cb(skb)->rx_sa;
+       struct macsec_rx_sc *rx_sc = rx_sa->sc;
        int len, ret;
        u32 pn;
 
@@ -891,6 +891,7 @@ static void macsec_decrypt_done(struct crypto_async_request *base, int err)
 
 out:
        macsec_rxsa_put(rx_sa);
+       macsec_rxsc_put(rx_sc);
        dev_put(dev);
 }
 
@@ -1106,6 +1107,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
 
        list_for_each_entry_rcu(macsec, &rxd->secys, secys) {
                struct macsec_rx_sc *sc = find_rx_sc(&macsec->secy, sci);
+               sc = sc ? macsec_rxsc_get(sc) : NULL;
 
                if (sc) {
                        secy = &macsec->secy;
@@ -1180,8 +1182,10 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
 
        if (IS_ERR(skb)) {
                /* the decrypt callback needs the reference */
-               if (PTR_ERR(skb) != -EINPROGRESS)
+               if (PTR_ERR(skb) != -EINPROGRESS) {
                        macsec_rxsa_put(rx_sa);
+                       macsec_rxsc_put(rx_sc);
+               }
                rcu_read_unlock();
                *pskb = NULL;
                return RX_HANDLER_CONSUMED;
@@ -1197,6 +1201,7 @@ deliver:
 
        if (rx_sa)
                macsec_rxsa_put(rx_sa);
+       macsec_rxsc_put(rx_sc);
 
        ret = gro_cells_receive(&macsec->gro_cells, skb);
        if (ret == NET_RX_SUCCESS)
@@ -1212,6 +1217,7 @@ deliver:
 drop:
        macsec_rxsa_put(rx_sa);
 drop_nosa:
+       macsec_rxsc_put(rx_sc);
        rcu_read_unlock();
 drop_direct:
        kfree_skb(skb);
@@ -1646,7 +1652,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
 
        rtnl_lock();
        rx_sc = get_rxsc_from_nl(genl_info_net(info), attrs, tb_rxsc, &dev, &secy);
-       if (IS_ERR(rx_sc) || !macsec_rxsc_get(rx_sc)) {
+       if (IS_ERR(rx_sc)) {
                rtnl_unlock();
                return PTR_ERR(rx_sc);
        }
@@ -3173,6 +3179,8 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
        if (err < 0)
                return err;
 
+       dev_hold(real_dev);
+
        /* need to be already registered so that ->init has run and
         * the MAC addr is set
         */
@@ -3201,8 +3209,6 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
 
        macsec_generation++;
 
-       dev_hold(real_dev);
-
        return 0;
 
 del_dev:
index d94a978024d942c6fe620d455036075c0f2b153c..775674808249eb56fa0eb4087745b930b0bef411 100644 (file)
@@ -345,10 +345,8 @@ static int xgene_mdio_probe(struct platform_device *pdev)
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        csr_base = devm_ioremap_resource(dev, res);
-       if (IS_ERR(csr_base)) {
-               dev_err(dev, "Unable to retrieve mac CSR region\n");
+       if (IS_ERR(csr_base))
                return PTR_ERR(csr_base);
-       }
        pdata->mac_csr_addr = csr_base;
        pdata->mdio_csr_addr = csr_base + BLOCK_XG_MDIO_CSR_OFFSET;
        pdata->diag_csr_addr = csr_base + BLOCK_DIAG_CSR_OFFSET;
index 059f13b60fe02f1eb4b51294b01d736acd58665e..1882d9828c998c376b20c50f83e25f8e03f22b0c 100644 (file)
@@ -869,7 +869,7 @@ static struct phy_driver ksphy_driver[] = {
 }, {
        .phy_id         = PHY_ID_KSZ8001,
        .name           = "Micrel KSZ8001 or KS8721",
-       .phy_id_mask    = 0x00ffffff,
+       .phy_id_mask    = 0x00fffffc,
        .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8041_type,
@@ -993,7 +993,7 @@ MODULE_LICENSE("GPL");
 static struct mdio_device_id __maybe_unused micrel_tbl[] = {
        { PHY_ID_KSZ9021, 0x000ffffe },
        { PHY_ID_KSZ9031, MICREL_PHY_ID_MASK },
-       { PHY_ID_KSZ8001, 0x00ffffff },
+       { PHY_ID_KSZ8001, 0x00fffffc },
        { PHY_ID_KS8737, MICREL_PHY_ID_MASK },
        { PHY_ID_KSZ8021, 0x00ffffff },
        { PHY_ID_KSZ8031, 0x00ffffff },
index 2fc50ec453d05c369c4702b6a3f73e2e0095134a..6f044450b7024a359ef5a06a51407d81578aeb17 100644 (file)
@@ -862,7 +862,7 @@ static int uhdlc_suspend(struct device *dev)
 static int uhdlc_resume(struct device *dev)
 {
        struct ucc_hdlc_private *priv = dev_get_drvdata(dev);
-       struct ucc_tdm *utdm = priv->utdm;
+       struct ucc_tdm *utdm;
        struct ucc_tdm_info *ut_info;
        struct ucc_fast __iomem *uf_regs;
        struct ucc_fast_private *uccf;
@@ -877,6 +877,7 @@ static int uhdlc_resume(struct device *dev)
        if (!netif_running(priv->ndev))
                return 0;
 
+       utdm = priv->utdm;
        ut_info = priv->ut_info;
        uf_info = &ut_info->uf_info;
        uf_regs = priv->uf_regs;
index 8c337cd0e1e45c5fcf4abdbb20f9ef43a36a3968..5b847e49f7e9bf31743a711b38f69fbfb746296a 100644 (file)
@@ -214,7 +214,7 @@ typedef enum {
        SCTP_SS_LISTENING      = TCP_LISTEN,
        SCTP_SS_ESTABLISHING   = TCP_SYN_SENT,
        SCTP_SS_ESTABLISHED    = TCP_ESTABLISHED,
-       SCTP_SS_CLOSING        = TCP_CLOSING,
+       SCTP_SS_CLOSING        = TCP_CLOSE_WAIT,
 } sctp_sock_state_t;
 
 /* These functions map various type to printable names.  */
index b26aa870adc0001b7d5a1156f581afa0b3476965..bdaef7fd6e47701b2d2280e1f40f816e1920c432 100644 (file)
@@ -236,7 +236,8 @@ void tcp_select_initial_window(int __space, __u32 mss,
                /* Set window scaling on max possible window
                 * See RFC1323 for an explanation of the limit to 14
                 */
-               space = max_t(u32, sysctl_tcp_rmem[2], sysctl_rmem_max);
+               space = max_t(u32, space, sysctl_tcp_rmem[2]);
+               space = max_t(u32, space, sysctl_rmem_max);
                space = min_t(u32, space, *window_clamp);
                while (space > 65535 && (*rcv_wscale) < 14) {
                        space >>= 1;
index 6287a8b9f428213eef68419d2a35325cd8a574b7..ab3e796596b1dc065ba46390e82306fe138c8509 100644 (file)
@@ -3624,8 +3624,7 @@ restart:
                        state = ifa->state;
                        ifa->state = INET6_IFADDR_STATE_DEAD;
 
-                       list_del(&ifa->if_list);
-                       list_add(&ifa->if_list, &del_list);
+                       list_move(&ifa->if_list, &del_list);
                }
 
                spin_unlock_bh(&ifa->lock);
index 7425f6c238889d8eb33edfb3f2e2eb7af39847e8..1f1682b9a6a82cc18d2571cf8287cfd194c7840d 100644 (file)
@@ -610,7 +610,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
                                /* We will generate more packets, so re-queue
                                 * auth chunk.
                                 */
-                               list_add(&chunk->list, &packet->chunk_list);
+                               list_add(&packet->auth->list,
+                                        &packet->chunk_list);
                        } else {
                                sctp_chunk_free(packet->auth);
                                packet->auth = NULL;
index 8812e1bf6c1c18fa7e20fdc478633615630162b6..9fc417a8b47691258ba64546222905f205f5a9aa 100644 (file)
@@ -2079,7 +2079,7 @@ static int sctp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
        lock_sock(sk);
 
        if (sctp_style(sk, TCP) && !sctp_sstate(sk, ESTABLISHED) &&
-           !sctp_sstate(sk, CLOSING)) {
+           !sctp_sstate(sk, CLOSING) && !sctp_sstate(sk, CLOSED)) {
                err = -ENOTCONN;
                goto out;
        }
index ec166d2bd2d95d9aa69369da2ead9437da4ce8ed..877e55066f89fa34bad5b81f8fdcf07d2818d5eb 100644 (file)
@@ -204,7 +204,9 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
        /* If the socket is just going to throw this away, do not
         * even try to deliver it.
         */
-       if (sock_flag(sk, SOCK_DEAD) || (sk->sk_shutdown & RCV_SHUTDOWN))
+       if (sk->sk_shutdown & RCV_SHUTDOWN &&
+           (sk->sk_shutdown & SEND_SHUTDOWN ||
+            !sctp_ulpevent_is_notification(event)))
                goto out_free;
 
        if (!sctp_ulpevent_is_notification(event)) {
index be70a57c1ff9a060021b8db620ce9d495b331a87..b62caa1c770c042fa7449f401bcb333b3defa485 100644 (file)
@@ -794,10 +794,10 @@ int __tipc_nl_add_monitor(struct net *net, struct tipc_nl_msg *msg,
        return 0;
 
 attr_msg_full:
+       read_unlock_bh(&mon->lock);
        nla_nest_cancel(msg->skb, attrs);
 msg_full:
        genlmsg_cancel(msg->skb, hdr);
-       read_unlock_bh(&mon->lock);
 
        return -EMSGSIZE;
 }
This page took 0.080972 seconds and 5 git commands to generate.