]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI/DPC: Hold pci_dev reference during error recovery
authorSizhe Liu <liusizhe5@huawei.com>
Wed, 11 Mar 2026 19:52:11 +0000 (14:52 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 16 Mar 2026 21:01:51 +0000 (16:01 -0500)
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 <liusizhe5@huawei.com>
[bhelgaas: split to separate patch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
https://patch.msgid.link/20260214081130.1878424-1-liusizhe5@huawei.com

drivers/pci/pcie/dpc.c

index fc18349614d7cff537fab14b0cabe78e1c414305..f028bc795f197bebee9956588591bd1f5bd656d2 100644 (file)
@@ -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;
 }