mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
PCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity()
If msi_setup_entry() fails to allocate an affinity mask, it logs a message
but continues on and allocates an MSI entry with entry->affinity == NULL.
Check for this case in pci_irq_get_affinity() so we don't try to
dereference a NULL pointer.
[bhelgaas: changelog]
Fixes: ee8d41e53e "pci/msi: Retrieve affinity for a vector"
Signed-off-by: Jan Beulich <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
CC: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
1001354ca3
commit
d1d111e073
1 changed files with 2 additions and 1 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in a new issue