[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/29] hw/pci: fixed error flow in pci_qdev_init
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 20/29] hw/pci: fixed error flow in pci_qdev_init |
Date: |
Mon, 3 Nov 2014 14:45:48 +0200 |
From: Marcel Apfelbaum <address@hidden>
Verify return code for pci_add_option_rom.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
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;
}
--
MST
- [Qemu-devel] [PULL 10/29] acpi: create separate file for TCPA log, (continued)
- [Qemu-devel] [PULL 10/29] acpi: create separate file for TCPA log, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 12/29] acpi:ich9: convert cpu hotplug to hotplug_handler API, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 11/29] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 13/29] acpi:piix4: convert cpu hotplug to hotplug_handler API, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 14/29] pc: add cpu hotplug handler to PC_MACHINE, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 15/29] pc: Update rtc_cmos in pc_cpu_plug, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 16/29] qom/cpu: remove the unused CPU hot-plug notifier, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 17/29] cpu-hotplug: rename function for better readability, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 18/29] acpi/cpu-hotplug: introduce helper function to keep bit setting in one place, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 19/29] -machine vmport=off: Allow disabling of VMWare ioport emulation, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 20/29] hw/pci: fixed error flow in pci_qdev_init,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 21/29] hw/pci: fixed hotplug crash when using rombar=0 with devices having romfile, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 22/29] hw/virtio/vring/event_idx: fix the vring_avail_event error, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 23/29] pc: Add pc_compat_2_1() function, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 24/29] smbios: Encode UUID according to SMBIOS specification, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 26/29] qemu-char: fix tcp_get_fds, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 25/29] hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup(), Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 28/29] vga: add default display to machine class, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 29/29] vga: flip qemu 2.2 pc machine types from cirrus to stdvga, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation, Michael S. Tsirkin, 2014/11/03