From d3e2fb4bfdaea571c8622059ddba7afeb1bd2d5a Mon Sep 17 00:00:00 2001 From: Kamala Narasimhan Date: Mon, 27 Jul 2009 21:31:48 -0400 Subject: [PATCH] Initialize SMBIOS oem types header whether or not oem types pass through is specified in the config file. --- xenguest/smbios_decode.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/xenguest/smbios_decode.c b/xenguest/smbios_decode.c index 8e4c110..a8ea3e0 100644 --- a/xenguest/smbios_decode.c +++ b/xenguest/smbios_decode.c @@ -309,8 +309,11 @@ static uint8_t copy_smbios_oem_types_pt_info(struct hvm_sminfo_table *va_sm, uin location = (uint8_t*)va_sm + sizeof(struct hvm_sminfo_table) + va_sm->total_length; ((struct hvm_smoem_types_header*)location)->sm_oem_types_length = size; - location += sizeof(struct hvm_smoem_types_header); - memcpy(location, oem_types, size); + if ( oem_types_count > 0 ) + { + location += sizeof(struct hvm_smoem_types_header); + memcpy(location, oem_types, size); + } va_sm->total_length += sizeof(struct hvm_smoem_types_header) + size; return 0; @@ -338,13 +341,12 @@ int hvm_smbios_decode(struct hvm_sminfo_table *va_sm, char *smbios_oem_types) memset(oem_types, 0, sizeof(oem_types)); req_oem_types_count = parse_smbios_oem_types(smbios_oem_types, oem_types, SMBIOS_TYPE_VENDOR_MAX-SMBIOS_TYPE_VENDOR_MIN+1); - if ( req_oem_types_count > 0 ) { - rc = copy_smbios_oem_types_pt_info(va_sm, oem_types, req_oem_types_count); - if ( rc != 0 ) { - XG_LOG("Failed to copy SMBIOS OEM types PT info!\n"); - return rc; - } - } + } + + rc = copy_smbios_oem_types_pt_info(va_sm, oem_types, req_oem_types_count); + if ( rc != 0 ) { + XG_LOG("Failed to copy SMBIOS OEM types PT info!\n"); + return rc; } /* process the primary SMBIOS tables like the system and bios information, if anything -- 2.39.5