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

From: Manivannan Sadhasivam

Date: Mon Oct 12 2026 - 12:27:58 EST


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@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

- Mani

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