diff mbox series

phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl()

Message ID 20220408095617.2495234-1-lv.ruyi@zte.com.cn
State Accepted
Commit 751ee15da5e5d33e15726c1a79de0f5db8155bdd
Headers show
Series phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl() | expand

Commit Message

CGEL April 8, 2022, 9:56 a.m. UTC
From: Lv Ruyi <lv.ruyi@zte.com.cn>

of_parse_phandle() returns node pointer with refcount incremented, use
of_node_put() on it to decrease refcount when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/phy/ti/phy-ti-pipe3.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Vinod Koul April 11, 2022, 5:11 p.m. UTC | #1
On 08-04-22, 09:56, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> of_parse_phandle() returns node pointer with refcount incremented, use
> of_node_put() on it to decrease refcount when done.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c
index 2cbc91e535d4..f502c36f3be5 100644
--- a/drivers/phy/ti/phy-ti-pipe3.c
+++ b/drivers/phy/ti/phy-ti-pipe3.c
@@ -696,6 +696,7 @@  static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy)
 		}
 
 		control_pdev = of_find_device_by_node(control_node);
+		of_node_put(control_node);
 		if (!control_pdev) {
 			dev_err(dev, "Failed to get control device\n");
 			return -EINVAL;