From: Sizhe Liu Date: Wed, 11 Mar 2026 19:52:11 +0000 (-0500) Subject: PCI/DPC: Hold pci_dev reference during error recovery X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a1ed752bc7cb77b740cee671567d9508ae74becd;p=thirdparty%2Flinux.git PCI/DPC: Hold pci_dev reference during error recovery The AER and EDR error handling paths hold a reference on the pci_dev during recovery. Hold a reference during the DPC recovery path as well. Signed-off-by: Sizhe Liu [bhelgaas: split to separate patch] Signed-off-by: Bjorn Helgaas https://patch.msgid.link/20260214081130.1878424-1-liusizhe5@huawei.com --- diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index fc18349614d7c..f028bc795f197 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -372,11 +372,13 @@ static irqreturn_t dpc_handler(int irq, void *context) return IRQ_HANDLED; } + pci_dev_get(pdev); dpc_process_error(pdev); /* We configure DPC so it only triggers on ERR_FATAL */ pcie_do_recovery(pdev, pci_channel_io_frozen, dpc_reset_link); + pci_dev_put(pdev); return IRQ_HANDLED; }