Skip to content

Commit 584b457

Browse files
outman119vinodkoul
authored andcommitted
phy: ti: j721e-wiz: Fix device node reference leak in wiz_get_lane_phy_types()
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 <[email protected]> Signed-off-by: Felix Gu <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent f0cf0a8 commit 584b457

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
@@ -1425,6 +1425,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
14251425
dev_err(dev,
14261426
"%s: Reading \"reg\" from \"%s\" failed: %d\n",
14271427
__func__, subnode->name, ret);
1428+
of_node_put(serdes);
14281429
return ret;
14291430
}
14301431
of_property_read_u32(subnode, "cdns,num-lanes", &num_lanes);
@@ -1439,6 +1440,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
14391440
}
14401441
}
14411442

1443+
of_node_put(serdes);
14421444
return 0;
14431445
}
14441446

0 commit comments

Comments
 (0)