diff options
| author | Ali Tariq <alitariq45892@gmail.com> | 2026-07-16 15:20:53 +0500 |
|---|---|---|
| committer | Manivannan Sadhasivam <mani@kernel.org> | 2026-07-16 18:52:11 +0200 |
| commit | 22877a061f81c5d58041e384b3131684bec636b9 (patch) | |
| tree | 671f60030506a9215269bef05127bd53f1776eb6 /scripts/objdiff | |
| parent | dc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff) | |
| download | linux-22877a061f81c5d58041e384b3131684bec636b9.tar.gz linux-22877a061f81c5d58041e384b3131684bec636b9.zip | |
PCI: starfive: Fix resource leaks on error paths in host_init()
starfive_pcie_host_init() acquires the PHY, clocks/resets, and an
optional regulator in sequence, but does not correctly unwind these
resources when a later step fails.
If starfive_pcie_clk_rst_init() fails after the PHY has already been
successfully enabled, the function returns directly without disabling
the PHY, leaking it and leaving it powered.
If regulator_enable() fails for the optional vpcie3v3 regulator, the
failure is only logged; the function falls through and returns
success, leaving the driver believing the regulator is enabled while
continuing to configure PCIe hardware that may be unpowered. This
also leaves the clocks and PHY enabled with nothing to clean them up.
Disable the PHY on the clk/reset failure path, and disable the
clocks/resets and PHY, then return the error, if the regulator fails
to enable.
Build-tested and boot-tested on StarFive VisionFive 2 v1.2A
Fixes: 05a75df4182e ("PCI: starfive: Use regulator APIs to control the 3v3 power supply of PCIe slots")
Fixes: 39b91eb40c6a ("PCI: starfive: Add JH7110 PCIe controller")
Signed-off-by: Ali Tariq <alitariq45892@gmail.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260716102053.185276-1-alitariq45892@gmail.com
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
