diff options
author | Igor Mammedov <imammedo@redhat.com> | 2024-03-14 16:22:53 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-03-18 08:42:45 -0400 |
commit | 643e1c9ef9d90a6e80b82998d41c91302fef506b (patch) | |
tree | de2b3799fea8c84decebeca94ef6968a3c187a8a /hw/i386 | |
parent | b42b0e4daaa543bc9f8e24662f94d65f6481c4a0 (diff) | |
download | qemu-643e1c9ef9d90a6e80b82998d41c91302fef506b.zip qemu-643e1c9ef9d90a6e80b82998d41c91302fef506b.tar.gz qemu-643e1c9ef9d90a6e80b82998d41c91302fef506b.tar.bz2 |
smbios: handle errors consistently
Current code uses mix of error_report()+exit(1)
and error_setg() to handle errors.
Use newer error_setg() everywhere, beside consistency
it will allow to detect error condition without killing
QEMU and attempt switch-over to SMBIOS3.x tables/entrypoint
in follow up patch.
while at it, clear smbios_tables pointer after freeing.
that will avoid double free if smbios_get_tables() is called
multiple times.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Message-Id: <20240314152302.2324164-13-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/fw_cfg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index d128106..e387bf5 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -71,7 +71,8 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg) smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]); if (pcmc->smbios_legacy_mode) { - smbios_tables = smbios_get_table_legacy(&smbios_tables_len); + smbios_tables = smbios_get_table_legacy(&smbios_tables_len, + &error_fatal); fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES, smbios_tables, smbios_tables_len); return; |