Skip to content

Commit 7872733

Browse files
outman119gregkh
authored andcommitted
phy: ti: j721e-wiz: Fix device node reference leak in wiz_get_lane_phy_types()
[ Upstream commit 584b457 ] The serdes device_node is obtained using of_get_child_by_name(), which increments the reference count. However, it is never put, leading to a reference leak. Add the missing of_node_put() calls to ensure the reference count is properly balanced. Fixes: 7ae14cf ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver") Suggested-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Felix Gu <ustc.gu@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/20260212-wiz-v2-1-6e8bd4cc7a4a@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 379361c commit 7872733

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/phy/ti/phy-j721e-wiz.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
14261426
dev_err(dev,
14271427
"%s: Reading \"reg\" from \"%s\" failed: %d\n",
14281428
__func__, subnode->name, ret);
1429+
of_node_put(serdes);
14291430
return ret;
14301431
}
14311432
of_property_read_u32(subnode, "cdns,num-lanes", &num_lanes);
@@ -1440,6 +1441,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
14401441
}
14411442
}
14421443

1444+
of_node_put(serdes);
14431445
return 0;
14441446
}
14451447

0 commit comments

Comments
 (0)