From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGpCc-0007Bq-UO for qemu-devel@nongnu.org; Mon, 02 May 2011 05:14:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGpCb-0005lD-W2 for qemu-devel@nongnu.org; Mon, 02 May 2011 05:14:02 -0400 Received: from thoth.sbs.de ([192.35.17.2]:20292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGpCb-0005l4-N8 for qemu-devel@nongnu.org; Mon, 02 May 2011 05:14:01 -0400 Message-ID: <4DBE75D5.8050901@siemens.com> Date: Mon, 02 May 2011 11:13:57 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] MSI: Fix release of resources List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Alexander Graf , Gerd Hoffmann msi_init may fail, so the users should check msi_present before calling msi_uninit. Signed-off-by: Jan Kiszka --- hw/ide/ich.c | 2 +- hw/intel-hda.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 1.7.1