Commit fe97f59a authored by Thomas Gleixner's avatar Thomas Gleixner

PCI/MSI: Check for MSI enabled in __pci_msix_enable()

PCI/MSI and PCI/MSI-X are mutually exclusive, but the MSI-X enable code
lacks a check for already enabled MSI.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarAshok Raj <ashok.raj@intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20221111122013.653556720@linutronix.de
parent fd19ce77
......@@ -935,6 +935,11 @@ static int __pci_enable_msix_range(struct pci_dev *dev,
if (maxvec < minvec)
return -ERANGE;
if (dev->msi_enabled) {
pci_info(dev, "can't enable MSI-X (MSI already enabled)\n");
return -EINVAL;
}
if (WARN_ON_ONCE(dev->msix_enabled))
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment