Re: [PATCH v2] phy: hisilicon: hi3670: Fix OF node and device reference leaks

Manivannan Sadhasivam <[email protected]>
Newsgroups org.infradead.lists.linux-phy,org.kernel.vger.linux-kernel
Message-ID <izs7apwabpvluftq57ftvuo5bmcroulndwp7dnbd3hw4nk4eec@qap23jlf5rfd>
On Fri, Feb 20, 2026 at 12:38:43AM +0800, Haotian Zhang wrote:
> hi3670_pcie_get_resources_from_pcie() leaks two references:
> 1) The OF node returned by of_get_child_by_name() is never released.
> 2) The device returned by bus_find_device_by_of_node() is never put.
> 
> Fix both leaks by calling of_node_put() right after
> bus_find_device_by_of_node(), and put_device() after dev_get_regmap()
> when the temporary pcie_dev reference is no longer needed.
> 
> Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
> Suggested-by: Vladimir Oltean <[email protected]>
> Signed-off-by: Haotian Zhang <[email protected]>

Reviewed-by: Manivannan Sadhasivam <[email protected]>

- Mani

-- 
மணிவண்ணன் சதாசிவம்

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.