Skip to contentSkip to conversation

net: fec: put child node on error path

PATCH Applied Pan Bian 2 participants 2 messages Jan 20, 2021 – Jan 23, 2021

Subsystems (3)
lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 net: fec: put child node on error path

Also decrement the reference count of child device on error path.

Fixes 3e782985cb3c ("net: ethernet: fec: Allow configuration of MDIO bus speed")
---
 drivers/net/ethernet/freescale/fec_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +2 -1
index 04f24c66cf36..55c28fbc5f9e 100644
@@ -2165,9 +2165,9 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	fep->mii_bus->parent = &pdev->dev;
 
 	err = of_mdiobus_register(fep->mii_bus, node);
-	of_node_put(node);
 	if (err)
 		goto err_out_free_mdiobus;
+	of_node_put(node);
 
 	mii_cnt++;
 
@@ -2180,6 +2180,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 err_out_free_mdiobus:
 	mdiobus_free(fep->mii_bus);
 err_out:
+	of_node_put(node);
 	return err;
 }
 
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 7 lines · On Wed, 20 Jan 2021 04:20:37 -0800 you wrote:

Also decrement the reference count of child device on error path.

Fixes 3e782985cb3c ("net: ethernet: fec: Allow configuration of MDIO bus speed")
---
 drivers/net/ethernet/freescale/fec_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
- net: fec: put child node on error path

    https://git.kernel.org/netdev/net/c/0607a2cddb60

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html