Re: [PATCH] phy: HiSilicon: Fix PCIe device reference leak in hi3670_pcie_get_resources_from_pcie()
From: Manivannan Sadhasivam
Date: Mon Oct 12 2026 - 12:10:52 EST
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@xxxxxxxxxxxxxxx
Please don't CC stable for these trivial fixes.
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
- Mani
--
மணிவண்ணன் சதாசிவம்