From: Igor Mammedov Date: Thu, 14 Mar 2024 15:22:55 +0000 (+0100) Subject: smbios: clear smbios_type4_count before building tables X-Git-Tag: v9.0.0-rc0~5^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6735a4943e024715cf256625f02231e88f76c40b;p=thirdparty%2Fqemu.git smbios: clear smbios_type4_count before building tables it will help to keep type 4 tables accounting correct in case SMBIOS tables are built multiple times. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner Message-Id: <20240314152302.2324164-15-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 0ab77b5ec8d..48713aa5056 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -1096,6 +1096,7 @@ void smbios_get_tables(MachineState *ms, ep_type == SMBIOS_ENTRY_POINT_TYPE_64); g_free(smbios_tables); + smbios_type4_count = 0; smbios_tables = g_memdup2(usr_blobs, usr_blobs_len); smbios_tables_len = usr_blobs_len; smbios_table_max = usr_table_max;