diff options
| author | Ruoyu Wang <ruoyuw560@gmail.com> | 2026-08-20 21:56:11 +0800 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-10-04 17:19:37 +0000 |
| commit | 3a4067658363e34bf4e1d7039e5b52951fcb4012 (patch) | |
| tree | eac5ad43c59577f88aa407f2b7e3f9b30be3f1fc /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | 8f8301eaa400d38c9e6ff7884cad777be64969b4 (diff) | |
perf/dwc_pcie: Fix PCI device reference leak in probe
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.
This issue was found by a static analysis checker and confirmed by manual
source review.
Fixes: 7f35b429802a ("perf/dwc_pcie: fix duplicate pci_dev devices")
Suggested-by: Markus Elfring <Markus.Elfring@web.de>
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions
