qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: jordan.l.justen@intel.com, anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH 2/2] pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path
Date: Thu, 16 Aug 2012 13:41:13 +0200	[thread overview]
Message-ID: <1345117273-19526-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1345117273-19526-1-git-send-email-armbru@redhat.com>

Harmless, because we the error inevitably leads to another, fatal one
in pc_system_flash_init(): PC system firmware (pflash) not available.
Fix it anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/pc_sysfw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index fd22154..ebb6b25 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -103,7 +103,9 @@ static void pc_fw_add_pflash_drv(void)
       return;
     }
 
-    drive_init(opts, machine->use_scsi);
+    if (!drive_init(opts, machine->use_scsi)) {
+        qemu_opts_del(opts);
+    }
 }
 
 static void pc_system_flash_init(MemoryRegion *rom_memory,
-- 
1.7.11.2

  parent reply	other threads:[~2012-08-16 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 11:41 [Qemu-devel] [PATCH 0/2] Fix two buggy pc_sysfw error paths Markus Armbruster
2012-08-16 11:41 ` [Qemu-devel] [PATCH 1/2] pc_sysfw: Check for qemu_find_file() failure Markus Armbruster
2012-08-16 13:30   ` Luiz Capitulino
2012-08-16 13:50     ` Markus Armbruster
2012-08-16 13:58       ` Kevin Wolf
2012-08-16 14:03       ` Luiz Capitulino
2012-08-16 14:32         ` Markus Armbruster
2012-08-16 14:49           ` Luiz Capitulino
2012-08-16 15:12             ` Markus Armbruster
2012-08-16 16:49               ` Luiz Capitulino
2012-08-16 17:58                 ` Luiz Capitulino
2012-08-16 17:10   ` Jordan Justen
2012-08-16 11:41 ` Markus Armbruster [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-23 18:12 [Qemu-devel] [PATCH 0/2] pc_fw_add_pflash_drv() fixes Markus Armbruster
2012-11-23 18:12 ` [Qemu-devel] [PATCH 2/2] pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path Markus Armbruster
2012-12-03 13:06   ` Stefan Hajnoczi

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=1345117273-19526-3-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=jordan.l.justen@intel.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).