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;
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