summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-12-12 18:25:04 +0100
committerBjorn Helgaas <bhelgaas@google.com>2016-12-12 18:25:04 +0100
commitdb5ba864126476fcaa3778b40d12f25168af206b (patch)
treed90e40908cb8e8a8aa4b5dd046d3ff32e0088cc3 /drivers/pci
parentMerge branch 'pci/misc' into next (diff)
parentPCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity() (diff)
downloadlinux-db5ba864126476fcaa3778b40d12f25168af206b.tar.xz
linux-db5ba864126476fcaa3778b40d12f25168af206b.zip
Merge branch 'pci/msi' into next
* pci/msi: PCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity()
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/msi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index bfdd0744b686..da4e3c1248db 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1292,7 +1292,8 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr)
} else if (dev->msi_enabled) {
struct msi_desc *entry = first_pci_msi_entry(dev);
- if (WARN_ON_ONCE(!entry || nr >= entry->nvec_used))
+ if (WARN_ON_ONCE(!entry || !entry->affinity ||
+ nr >= entry->nvec_used))
return NULL;
return &entry->affinity[nr];