[PATCH v2] perf/dwc_pcie: Fix PCI device reference leak in probe
Will Deacon
will at kernel.org
Sun Oct 4 15:09:19 PDT 2026
On Thu, 20 Aug 2026 21:56:11 +0800, Ruoyu Wang wrote:
> pci_get_domain_bus_and_slot() returns a referenced PCI device. When the
> subsequent RAS DES capability lookup fails, dwc_pcie_pmu_probe() returns
> -ENODEV without releasing that reference. Repeated failed probes can
> therefore keep the PCI device allocated after removal.
>
> Declare the looked-up device with __free(pci_dev_put), so the temporary
> reference is released on every return path. Keeping the reference scoped
> to the whole probe also covers all later uses of the device during
> initialization.
>
> [...]
Applied to arm64 (for-next/perf), thanks!
[1/1] perf/dwc_pcie: Fix PCI device reference leak in probe
https://git.kernel.org/arm64/c/3a4067658363
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
More information about the linux-arm-kernel
mailing list