Commit 520064c8 authored by Jan Kiszka's avatar Jan Kiszka Committed by Michael S. Tsirkin
Browse files

msi: Guard msi_reset with msi_present

parent 8ab60a07
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -191,6 +191,10 @@ void msi_reset(PCIDevice *dev)
    uint16_t flags;
    bool msi64bit;

    if (!msi_present(dev)) {
        return;
    }

    flags = pci_get_word(dev->config + msi_flags_off(dev));
    flags &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE);
    msi64bit = flags & PCI_MSI_FLAGS_64BIT;