]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
Initialize SMBIOS oem types header whether or not oem types pass through is specified...
authorKamala Narasimhan <kamala.narasimhan@citrix.com>
Tue, 28 Jul 2009 01:31:48 +0000 (21:31 -0400)
committerKamala Narasimhan <kamala.narasimhan@citrix.com>
Tue, 28 Jul 2009 01:31:48 +0000 (21:31 -0400)
xenguest/smbios_decode.c

index 8e4c1104a8c6eed2f65efe8d70e4a658d0acae35..a8ea3e0155cecf6f620629233af95e064c1c304d 100644 (file)
@@ -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