From 45fe15c25a5c9feea6e0f78434f5e9f632de9d94 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Mon, 2 May 2011 20:00:47 +0200 Subject: 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 Signed-off-by: Michael S. Tsirkin --- hw/intel-hda.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'hw/intel-hda.c') 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; } -- cgit 1.4.1