Skip to content

Commit

Permalink
Merge branch 'pci/controller/hv'
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
bjorn-helgaas committed Aug 29, 2023
2 parents 9190819 + 04bbe86 commit 59a2b16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/pci/controller/pci-hyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 59a2b16

Please sign in to comment.