]> git.proxmox.com Git - qemu.git/commitdiff
msi: Guard msi_reset with msi_present
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 11 May 2012 14:42:37 +0000 (11:42 -0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 7 Jun 2012 14:18:59 +0000 (17:18 +0300)
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/msi.c

index 5d6ceb6df01655607393630de770277d683638fa..b2903fc93c28185c8865a60534e581a0db5756f5 100644 (file)
--- a/hw/msi.c
+++ b/hw/msi.c
@@ -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;