Patchwork [RFC,02/45] msi: Guard msi_reset with msi_present

login
register
mail settings
Submitter Jan Kiszka
Date Oct. 17, 2011, 9:27 a.m.
Message ID <82ed4816adf673b7b9ecbe8a6ac3b5a8ee35de76.1318843693.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/120183/
State New
Headers show

Comments

Jan Kiszka - Oct. 17, 2011, 9:27 a.m.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/msi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/msi.c b/hw/msi.c
index bbc9cd7..5dbcccc 100644
--- a/hw/msi.c
+++ b/hw/msi.c
@@ -288,6 +288,9 @@  void msi_reset(PCIDevice *dev)
     uint16_t flags;
     bool msi64bit;
 
+    if (!msi_present(dev)) {
+        return;
+    }
     if (kvm_enabled() && kvm_irqchip_in_kernel()) {
         kvm_msi_free(dev);
     }