qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Alexander Graf <agraf@suse.de>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH] MSI: Fix release of resources
Date: Mon, 02 May 2011 11:13:57 +0200	[thread overview]
Message-ID: <4DBE75D5.8050901@siemens.com> (raw)

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(-)

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

             reply	other threads:[~2011-05-02  9:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02  9:13 Jan Kiszka [this message]
2011-05-02 18:00 ` [Qemu-devel] [PATCH v2] MSI: Robust resource release Jan Kiszka
2011-05-03 10:16   ` Alexander Graf
2011-05-05 13:10   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DBE75D5.8050901@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=agraf@suse.de \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).