Skip to contentSkip to conversation

net: ethernet: mediatek: add missing of_node_put() in mtk_sgmii_init()

PATCH Applied Yang Yingliang 2 participants 2 messages Apr 28, 2022 – Apr 30, 2022

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

PATCH 1/1 net: ethernet: mediatek: add missing of_node_put() in mtk_sgmii_init()

The node pointer returned by of_parse_phandle() with refcount incremented, so add of_node_put() after using it in mtk_sgmii_init().

Fixes 9ffee4a8276c ("net: ethernet: mediatek: Extend SGMII related functions")
---
 drivers/net/ethernet/mediatek/mtk_sgmii.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/mediatek/mtk_sgmii.c +1 -0
index 32d83421226a..5897940a418b 100644
@@ -26,6 +26,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *r, u32 ana_rgc3)
 			break;
 
 		ss->regmap[i] = syscon_node_to_regmap(np);
+		of_node_put(np);
 		if (IS_ERR(ss->regmap[i]))
 			return PTR_ERR(ss->regmap[i]);
 	}
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 Thu, 28 Apr 2022 14:25:43 +0800 you wrote:

The node pointer returned by of_parse_phandle() with refcount incremented, so add of_node_put() after using it in mtk_sgmii_init().

Fixes 9ffee4a8276c ("net: ethernet: mediatek: Extend SGMII related functions")
---
 drivers/net/ethernet/mediatek/mtk_sgmii.c | 1 +
 1 file changed, 1 insertion(+)

Here is the summary with links:
- net: ethernet: mediatek: add missing of_node_put() in mtk_sgmii_init()

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

You are awesome, thank you!

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