Skip to contentSkip to conversation

net: sungem_phy: Add of_node_put() for reference returned by of_get_parent()

PATCH Applied Liang He 2 participants 2 messages Jul 20, 2022 – Jul 22, 2022

Subsystems (2)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 net: sungem_phy: Add of_node_put() for reference returned by of_get_parent()

In bcm5421_init(), we should call of_node_put() for the reference returned by of_get_parent() which has increased the refcount.

Fixes 3c326fe9cb7a ("[PATCH] ppc64: Add new PHY to sungem")
---
 drivers/net/sungem_phy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/sungem_phy.c +1 -0
index ff22b6b1c686..36803d932dff 100644
@@ -450,6 +450,7 @@ static int bcm5421_init(struct mii_phy* phy)
 		int can_low_power = 1;
 		if (np == NULL || of_get_property(np, "no-autolowpower", NULL))
 			can_low_power = 0;
+		of_node_put(np);
 		if (can_low_power) {
 			/* Enable automatic low-power */
 			sungem_phy_write(phy, 0x1c, 0x9002);
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 8 lines · On Wed, 20 Jul 2022 21:10:03 +0800 you wrote:

In bcm5421_init(), we should call of_node_put() for the reference returned by of_get_parent() which has increased the refcount.

Fixes 3c326fe9cb7a ("[PATCH] ppc64: Add new PHY to sungem")
---
 drivers/net/sungem_phy.c | 1 +
 1 file changed, 1 insertion(+)

Here is the summary with links:
- net: sungem_phy: Add of_node_put() for reference returned by of_get_parent()

    https://git.kernel.org/netdev/net/c/ebbbe23fdf60

You are awesome, thank you!

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