Skip to contentSkip to conversation

net: freescale: ucc_geth: call of_node_put once

PATCH Applied Rosen Penev 3 participants 3 messages Feb 24 – Feb 25

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: freescale: ucc_geth: call of_node_put once

Move it up to avoid placing it in both the error and success paths.

---
 drivers/net/ethernet/freescale/ucc_geth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/freescale/ucc_geth.c +1 -2
index 78d72409b6e0..4d598693d7a6 100644
@@ -3470,14 +3470,13 @@ static int ucc_geth_probe(struct platform_device* ofdev)
 	phy_node = of_parse_phandle(np, "phy-handle", 0);
 	if (phy_node) {
 		prop = of_get_property(phy_node, "interface", NULL);
+		of_node_put(phy_node);
 		if (prop) {
 			dev_err(&ofdev->dev,
 				"Device-tree property 'interface' is no longer supported. Please use 'phy-connection-type' instead.");
-			of_node_put(phy_node);
 			err = -EINVAL;
 			goto err_put_tbi;
 		}
-		of_node_put(phy_node);
 	}
 
 	err = of_get_phy_mode(np, &phy_interface);

--
2.53.0

reviewer Reviewed-by on v1 1/1
#1 lore raw

+ Maxime

Quoted 3 lines · Rosen Penev

Move it up to avoid placing it in both the error and success paths.

Quoted 28 lines
---
 drivers/net/ethernet/freescale/ucc_geth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/freescale/ucc_geth.c +1 -3
index 78d72409b6e0..4d598693d7a6 100644
@@ -3470,14 +3470,13 @@ static int ucc_geth_probe(struct platform_device* ofdev)
 	phy_node = of_parse_phandle(np, "phy-handle", 0);
 	if (phy_node) {
 		prop = of_get_property(phy_node, "interface", NULL);
+		of_node_put(phy_node);
 		if (prop) {
 			dev_err(&ofdev->dev,
 				"Device-tree property 'interface' is no longer supported. Please use 'phy-connection-type' instead.");
-			of_node_put(phy_node);
 			err = -EINVAL;
 			goto err_put_tbi;
 		}
-		of_node_put(phy_node);
 	}
 
 	err = of_get_phy_mode(np, &phy_interface);
--

2.53.0

#2 lore raw
In reply to Rosen Penev
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 23 Feb 2026 17:41:41 -0800 you wrote:

Move it up to avoid placing it in both the error and success paths.

---
 drivers/net/ethernet/freescale/ucc_geth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

[...]

Here is the summary with links:
- [net-next] net: freescale: ucc_geth: call of_node_put once

    https://git.kernel.org/netdev/net-next/c/d2adf01780b8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html