Re: [PATCH] fix: net: ti: cpts_of_mux_clk_setup: fix device_node reference leak on success path

From: Andrew Lunn

Date: Fri Jun 26 2026 - 12:19:47 EST


On Fri, Jun 26, 2026 at 11:31:48PM +0800, WenTao Liang wrote:
> of_get_child_by_name acquires a device_node reference for refclk_np, and
> of_clk_add_hw_provider additionally takes an extra reference internally.
> On the success path, the function returns 0 without calling
> of_node_put(refclk_np), leaking the initial reference.
>
> Add of_node_put(refclk_np) before returning success to properly release
> the acquired reference.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: a3047a81ba13 ("net: ethernet: ti: cpts: add support for ext rftclk selection")
> Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>


Andrew

---
pw-bot: cr