[PATCH] phy: HiSilicon: Fix device node reference leak in hi3670_pcie_get_resources_from_pcie()

Manivannan Sadhasivam mani at kernel.org
Mon Oct 12 09:09:58 PDT 2026


On Thu, Sep 17, 2026 at 01:41:44PM +0000, Wentao Liang wrote:
> hi3670_pcie_get_resources_from_pcie() obtains the "pcie" child node
> with of_get_child_by_name(), which takes a reference on the node, but
> never releases it: both the "Didn't find pcie device" and the "Failed
> to get APB regmap" error paths, as well as the success path, return
> without calling of_node_put().
> 
> The node is only needed for the device lookup, so drop the reference
> right after bus_find_device_by_of_node().
> 
> Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
> Cc: stable at vger.kernel.org
> Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam at oss.qualcomm.com>

- Mani

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



More information about the linux-phy mailing list