summaryrefslogtreecommitdiffstats
path: root/hw/intel-hda.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-05-02 20:00:47 +0200
committerMichael S. Tsirkin <mst@redhat.com>2011-05-05 16:10:08 +0300
commit45fe15c25a5c9feea6e0f78434f5e9f632de9d94 (patch)
tree0749b7fc7f98200e3c42d213b9916be135195151 /hw/intel-hda.c
parent072476ea08dcffe89b0bd6e2053f01dd89c54861 (diff)
downloadhqemu-45fe15c25a5c9feea6e0f78434f5e9f632de9d94.zip
hqemu-45fe15c25a5c9feea6e0f78434f5e9f632de9d94.tar.gz
MSI: Robust resource release
msi_init may fail, so we need to check on uninit if the cap was actually installed. This also avoids that the users need to check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/intel-hda.c')
-rw-r--r--hw/intel-hda.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 7f83745..5485745 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -1165,9 +1165,7 @@ static int intel_hda_exit(PCIDevice *pci)
{
IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci);
- if (d->msi) {
- msi_uninit(&d->pci);
- }
+ msi_uninit(&d->pci);
cpu_unregister_io_memory(d->mmio_addr);
return 0;
}
OpenPOWER on IntegriCloud