aboutsummaryrefslogtreecommitdiff
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)
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 7f83745d1a..5485745e85 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;
}