add missing of_node_put after calling of_parse_phandle
Subsystems (12)
v2 cover add missing of_node_put after calling of_parse_phandle
Hi David,
This patch set fixes missing of_node_put issue at ethernet driver. of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
The compilation test has passed by using allmodconfig for drivers/net/ethernet.
Thanks.
Changes for v2:
- If the device node is local variable, it can be put in the same function.
- If the device node will be used the whole driver life cycle, it should be put (call of_node_put) at driver's remove.
Patch [4, 5, 9, 14, 15/15]
- Fix the issue that the node still be used at error patch [6/15]
- Add acked for patch [11,12/15]
Peter Chen (15):
ethernet: altera: add missing of_node_put
ethernet: apm: xgene: 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: aurora: nb8800: add missing of_node_put after calling
of_parse_phandle
ethernet: cavium: octeon: 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: hisilicon: hns: hns_dsaf_main: add missing of_node_put after
calling of_parse_phandle
ethernet: marvell: mvneta: 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: pxa168_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: renesas: sh_eth: 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: stmicro: stmmac: add missing of_node_put after calling
of_parse_phandle
ethernet: ti: davinci_emac: add missing of_node_put after calling
of_parse_phandle
drivers/net/ethernet/altera/altera_tse_main.c | 1 + drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 1 + drivers/net/ethernet/arc/emac_main.c | 15 ++++++--- drivers/net/ethernet/aurora/nb8800.c | 2 ++ drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 3 ++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 9 ++++-- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 7 +++-- drivers/net/ethernet/marvell/mvneta.c | 1 + drivers/net/ethernet/marvell/mvpp2.c | 2 ++ drivers/net/ethernet/marvell/pxa168_eth.c | 1 + drivers/net/ethernet/renesas/ravb_main.c | 1 + drivers/net/ethernet/renesas/sh_eth.c | 1 + .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 36 ++++++++++++++++------ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++-- drivers/net/ethernet/ti/davinci_emac.c | 1 + 16 files changed, 67 insertions(+), 22 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/15 ethernet: altera: add missing of_node_put
of_node_put needs to be called when the device node which is got from of_parse_phandle (or of_node_get) has finished using.
--- drivers/net/ethernet/altera/altera_tse_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/altera/altera_tse_main.c +1 -0
@@ -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" );
Signature · 1 line
1.9.1
PATCH v2 2/15 ethernet: apm: xgene: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +1 -0
@@ -758,6 +758,7 @@ static int xgene_enet_phy_connect(struct net_device *ndev) phy_dev =of_phy_connect (ndev, phy_np, &xgene_enet_adjust_link,0 , pdata->phy_mode); +of_node_put (phy_np);if (!phy_dev) {netdev_err (ndev,"Could not connect to PHY\n" );return -ENODEV ;
Signature · 1 line
1.9.1
PATCH v2 5/15 ethernet: cavium: octeon: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +3 -0
@@ -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 ; }
Signature · 1 line
1.9.1
PATCH v2 4/15 ethernet: aurora: nb8800: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/aurora/nb8800.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/aurora/nb8800.c +2 -0
@@ -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);
Signature · 1 line
1.9.1
PATCH v2 6/15 ethernet: hisilicon: hns: hns_dsaf_mac: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c +6 -3
@@ -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 ;
Signature · 1 line
1.9.1
PATCH v2 8/15 ethernet: marvell: mvneta: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/marvell/mvneta.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/mvneta.c +1 -0
@@ -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 )
Signature · 1 line
1.9.1
PATCH v2 9/15 ethernet: marvell: mvpp2: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/marvell/mvpp2.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/mvpp2.c +2 -0
@@ -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++)
Signature · 1 line
1.9.1
PATCH v2 10/15 ethernet: marvell: pxa168_eth: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/marvell/pxa168_eth.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/pxa168_eth.c +1 -0
@@ -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 */
Signature · 1 line
1.9.1
PATCH v2 11/15 ethernet: renesas: ravb_main: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/renesas/ravb_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/renesas/ravb_main.c +1 -0
@@ -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 ;
Signature · 1 line
1.9.1
PATCH v2 12/15 ethernet: renesas: sh_eth: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/renesas/sh_eth.c +1 -0
@@ -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 {
Signature · 1 line
1.9.1
PATCH v2 13/15 ethernet: stmicro: stmmac: dwmac-socfpga: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 36 ++++++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +26 -10
@@ -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)
Signature · 1 line
1.9.1
PATCH v2 14/15 ethernet: stmicro: stmmac: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
This commit fixes both local (in stmmac_axi_setup) and global (plat->phy_node) device_node for this issue, and using the correct device node when tries to put node at stmmac_probe_config_dt for error path.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
@@ -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);
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +5 -2
@@ -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;
Signature · 1 line
1.9.1
PATCH v2 15/15 ethernet: ti: davinci_emac: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/ti/davinci_emac.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/ti/davinci_emac.c +1 -0
@@ -2060,6 +2060,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);
Signature · 1 line
1.9.1
PATCH v2 3/15 ethernet: arc: emac_main: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/arc/emac_main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/ethernet/arc/emac_main.c +11 -4
@@ -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);
Signature · 1 line
1.9.1
PATCH v2 7/15 ethernet: hisilicon: hns: hns_dsaf_main: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +4 -3
@@ -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++);
Signature · 1 line
1.9.1
Re: [PATCH v2 14/15] ethernet: stmicro: stmmac: add missing of_node_put after calling of_parse_phandle
In reply to Peter ChenHi,
Quoted 52 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.This commit fixes both local (in
stmmac_axi_setup) and global (plat->phy_node)device_nodefor this issue, and using the correct device node when tries to put node atstmmac_probe_config_dtfor error path.Signed-off-by Peter Chen <[email protected]>--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1
-0@@ -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);drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +4
-1@@ -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; }
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) · line 311
Quoted 8 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +1
-1@@ -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;
You can add my:
Regards
Alex
Re: [PATCH v2 15/15] ethernet: ti: davinci_emac: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chen+omap ML
Quoted 4 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Signed-off-by Peter Chen <[email protected]>
Regards
Mugunthan V N
David Miller
maintainerFrom: Peter Chen <[email protected]>
Date: Mon, 1 Aug 2016 15:02:28 +0800
Quoted 8 lines
This patch set fixes missing
of_node_putissue at ethernet driver.of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.The compilation test has passed by using allmodconfig for
drivers/net/ethernet.Thanks.
Quoted 7 lines
Changes for v2:
- If the device node is local variable, it can be put in the same function.
- If the device node will be used the whole driver life cycle, it should be put (callof_node_put) at driver's remove.
Patch [4, 5, 9, 14, 15/15]
- Fix the issue that the node still be used at error patch [6/15]
- Add acked for patch [11,12/15]
Series applied, thanks.