commit | 520064c8b15504fb75babce7be6b5800b54ec490 | [log] [tgz] |
---|---|---|
author | Jan Kiszka <jan.kiszka@siemens.com> | Fri May 11 11:42:37 2012 -0300 |
committer | Michael S. Tsirkin <mst@redhat.com> | Thu Jun 07 17:18:59 2012 +0300 |
tree | 2f49fb5097dcb158f18b25f33e31e27eddd90768 | |
parent | 8ab60a0703d182d61a0c4e3db35cf70ab57d89aa [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>
diff --git a/hw/msi.c b/hw/msi.c index 5d6ceb6..b2903fc 100644 --- a/hw/msi.c +++ b/hw/msi.c
@@ -191,6 +191,10 @@ 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;