From: Marcel Apfelbaum <marcel.a@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcel@redhat.com, pbonzini@redhat.com,
alex.williamson@redhat.com, armbru@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH v3 1/2] hw/pci: fixed error flow in pci_qdev_init
Date: Mon, 27 Oct 2014 18:41:21 +0200 [thread overview]
Message-ID: <1414428082-7341-2-git-send-email-marcel.a@redhat.com> (raw)
In-Reply-To: <1414428082-7341-1-git-send-email-marcel.a@redhat.com>
Verify return code for pci_add_option_rom.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
hw/pci/pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 6ce75aa..36226eb 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1776,7 +1776,12 @@ static int pci_qdev_init(DeviceState *qdev)
pci_dev->romfile = g_strdup(pc->romfile);
is_default_rom = true;
}
- pci_add_option_rom(pci_dev, is_default_rom);
+
+ rc = pci_add_option_rom(pci_dev, is_default_rom);
+ if (rc != 0) {
+ pci_unregister_device(DEVICE(pci_dev));
+ return rc;
+ }
return 0;
}
--
1.8.3.1
next prev parent reply other threads:[~2014-10-27 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 16:41 [Qemu-devel] [PATCH v3 0/2] hw/pci: fixed hotplug crash when using rombar=0 with devices having romfile Marcel Apfelbaum
2014-10-27 16:41 ` Marcel Apfelbaum [this message]
2014-10-27 16:41 ` [Qemu-devel] [PATCH v3 2/2] " Marcel Apfelbaum
2014-10-27 17:10 ` Eric Blake
2014-10-27 17:15 ` Marcel Apfelbaum
2014-10-27 17:21 ` 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=1414428082-7341-2-git-send-email-marcel.a@redhat.com \
--to=marcel.a@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@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).