[PATCH] phy: tegra: xusb: fix OF node leak on lane probe failure
From: Zhao Feng
Date: Mon Nov 09 2026 - 02:54:34 EST
tegra_xusb_pad_register() obtains a reference to each lane node via
tegra_xusb_pad_find_phy_node(). On success the reference is
transferred into the lane (lane->np), and the disabled-lane and
phy_create() failure paths drop it, but the pad->ops->probe()
failure path (e.g. tegra_xusb_lane_parse_dt() rejecting the
"nvidia,function" property) jumps to remove without dropping it,
leaking one node reference per failed lane.
Drop the reference on that path, mirroring the phy_create() failure
path right above.
Fixes: 53d2a715c240 ("phy: Add Tegra XUSB pad controller support")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Zhao Feng <zhaofeng2@xxxxxxxxxxxxxxxxxxxx>
---
Verified against current upstream master. Not runtime-tested (no
Tegra hardware).
drivers/phy/tegra/xusb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -234,6 +234,7 @@ int tegra_xusb_pad_register(struct tegra_xusb_pad *pad,
lane = pad->ops->probe(pad, np, i);
if (IS_ERR(lane)) {
phy_destroy(pad->lanes[i]);
+ of_node_put(np);
err = PTR_ERR(lane);
goto remove;
--
2.39.2