From: Gerd Hoffmann Date: Mon, 25 Apr 2022 13:50:49 +0000 (+0200) Subject: i386: move bios load error message X-Git-Tag: v7.1.0-rc0~125^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2aa6a39bc8ec1b94d926fb5a23483a23ff895a2a;p=thirdparty%2Fqemu.git i386: move bios load error message Switch to usual goto-end-of-function error handling style. No functional change. Signed-off-by: Gerd Hoffmann Tested-by: Xiaoyao Li Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Message-Id: <20220425135051.551037-2-kraxel@redhat.com> --- diff --git a/hw/i386/x86.c b/hw/i386/x86.c index bb672727909..ced31f67b9a 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -1120,9 +1120,7 @@ void x86_bios_rom_init(MachineState *ms, const char *default_firmware, } ret = rom_add_file_fixed(bios_name, (uint32_t)(-bios_size), -1); if (ret != 0) { - bios_error: - fprintf(stderr, "qemu: could not load PC BIOS '%s'\n", bios_name); - exit(1); + goto bios_error; } g_free(filename); @@ -1143,6 +1141,11 @@ void x86_bios_rom_init(MachineState *ms, const char *default_firmware, memory_region_add_subregion(rom_memory, (uint32_t)(-bios_size), bios); + return; + +bios_error: + fprintf(stderr, "qemu: could not load PC BIOS '%s'\n", bios_name); + exit(1); } bool x86_machine_is_smm_enabled(const X86MachineState *x86ms)