Patchwork MSI: Fix release of resources

login
register
mail settings
Submitter Jan Kiszka
Date May 2, 2011, 9:13 a.m.
Message ID <4DBE75D5.8050901@siemens.com>
Download mbox | patch
Permalink /patch/93612/
State New
Headers show

Comments

Jan Kiszka - May 2, 2011, 9:13 a.m.
msi_init may fail, so the users should check msi_present before calling
msi_uninit.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/ide/ich.c   |    2 +-
 hw/intel-hda.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index a3d475c..35e1de7 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -110,7 +110,7 @@  static int pci_ich9_uninit(PCIDevice *dev)
     struct AHCIPCIState *d;
     d = DO_UPCAST(struct AHCIPCIState, card, dev);
 
-    if (msi_enabled(dev)) {
+    if (msi_present(dev)) {
         msi_uninit(dev);
     }
 
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index b0b1d12..ff99348 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -1174,7 +1174,7 @@  static int intel_hda_exit(PCIDevice *pci)
 {
     IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci);
 
-    if (d->msi) {
+    if (msi_present(pci)) {
         msi_uninit(&d->pci);
     }
     cpu_unregister_io_memory(d->mmio_addr);