aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-05-11 11:42:37 -0300
committerMichael S. Tsirkin <mst@redhat.com>2012-06-07 17:18:59 +0300
commit520064c8b15504fb75babce7be6b5800b54ec490 (patch)
tree2f49fb5097dcb158f18b25f33e31e27eddd90768 /hw
parent8ab60a0703d182d61a0c4e3db35cf70ab57d89aa (diff)
msi: Guard msi_reset with msi_present
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/msi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/msi.c b/hw/msi.c
index 5d6ceb6df0..b2903fc93c 100644
--- 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;