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

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


On Thu, Sep 17, 2026 at 01:39:35PM +0000, Wentao Liang wrote:
> hi3670_pcie_get_resources_from_pcie() gets a reference to the PCIe
> platform device with bus_find_device_by_of_node(), but never releases
> it.  The reference is not stored anywhere, so it is leaked both when
> dev_get_regmap() fails and on the success path.
> 
> Drop the reference right after the regmap lookup, the last use of the
> device.
> 
> Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
> Cc: stable at vger.kernel.org

Please don't CC stable for these trivial fixes.

> 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