diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-29 11:03:52 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-29 11:03:52 -0500 |
commit | 59a2b16dd5c341b463b746e0fb5f3ab3663f8031 (patch) | |
tree | 3a2f4ff5f53f593e267cbe9971764e97f256a531 /drivers/pci | |
parent | 9190819c89b95cfc89bbc0cd0f6b49b90dacebb7 (diff) | |
parent | 04bbe863241a9be7d57fb4cf217ee4a72f480e70 (diff) |
Merge branch 'pci/controller/hv'
- To avoid a NULL pointer dereference, skip MSI restore after hibernate if
MSI/MSI-X hasn't been enabled (Dexuan Cui)
* pci/controller/hv:
PCI: hv: Fix a crash in hv_pci_restore_msi_msg() during hibernation
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/controller/pci-hyperv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 2d93d0c4f10d..bed3cefdaf19 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3983,6 +3983,9 @@ static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg) struct msi_desc *entry; int ret = 0; + if (!pdev->msi_enabled && !pdev->msix_enabled) + return 0; + msi_lock_descs(&pdev->dev); msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) { irq_data = irq_get_irq_data(entry->irq); |