mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
8ab60a0703
commit
520064c8b1
4
hw/msi.c
4
hw/msi.c
|
@ -191,6 +191,10 @@ void msi_reset(PCIDevice *dev)
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
bool msi64bit;
|
bool msi64bit;
|
||||||
|
|
||||||
|
if (!msi_present(dev)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
flags = pci_get_word(dev->config + msi_flags_off(dev));
|
flags = pci_get_word(dev->config + msi_flags_off(dev));
|
||||||
flags &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE);
|
flags &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE);
|
||||||
msi64bit = flags & PCI_MSI_FLAGS_64BIT;
|
msi64bit = flags & PCI_MSI_FLAGS_64BIT;
|
||||||
|
|
Loading…
Reference in New Issue