Message ID | 2f84f558-3f65-4c09-89b8-485830b98654@web.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | perf: hisi_pcie: Call pci_dev_put(pdev) only once in hisi_pcie_pmu_valid_requester_id() | expand |
diff --git a/drivers/perf/hisilicon/hisi_pcie_pmu.c b/drivers/perf/hisilicon/hisi_pcie_pmu.c index c5394d007b61..5ff1c47d68ad 100644 --- a/drivers/perf/hisilicon/hisi_pcie_pmu.c +++ b/drivers/perf/hisilicon/hisi_pcie_pmu.c @@ -290,12 +290,10 @@ static bool hisi_pcie_pmu_valid_requester_id(struct hisi_pcie_pmu *pcie_pmu, u32 return false; root_port = pcie_find_root_port(pdev); - if (!root_port) { - pci_dev_put(pdev); + pci_dev_put(pdev); + if (!root_port) return false; - } - pci_dev_put(pdev); rp_bdf = pci_dev_id(root_port); return rp_bdf >= pcie_pmu->bdf_min && rp_bdf <= pcie_pmu->bdf_max; }