From: Philippe Mathieu-Daudé Date: Mon, 20 Nov 2023 12:25:56 +0000 (+0100) Subject: hw/pci-host/raven: Propagate error in raven_realize() X-Git-Tag: v9.0.0-rc0~123^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb50fc6842bf95b4e3bc1faa2a56bf7987ea6491;p=thirdparty%2Fqemu.git hw/pci-host/raven: Propagate error in raven_realize() When an Error** reference is available, it is better to propagate local errors, rather then using generic ones, which might terminate the whole QEMU process. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-26-philmd@linaro.org> --- diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index f71d4872c80..c7a0a2878ab 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -345,8 +345,10 @@ static void raven_realize(PCIDevice *d, Error **errp) d->config[PCI_LATENCY_TIMER] = 0x10; d->config[PCI_CAPABILITY_LIST] = 0x00; - memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", BIOS_SIZE, - &error_fatal); + if (!memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", + BIOS_SIZE, errp)) { + return; + } memory_region_add_subregion(get_system_memory(), (uint32_t)(-BIOS_SIZE), &s->bios); if (s->bios_name) {