summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c')
-rw-r--r--EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c b/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c
index 3358a96672..5c62cc6b53 100644
--- a/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c
+++ b/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/MiscConv.c
@@ -2391,30 +2391,28 @@ SmbiosFldMiscTypeOEM (
ASSERT_EFI_ERROR (Status);
if (StructureSize < RecordDataSize) {
- Status = SmbiosEnlargeStructureBuffer (
- StructureNode,
- ((EFI_SMBIOS_TABLE_HEADER *)RecordData)->Length,
- StructureSize,
- RecordDataSize
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ //
+ // Create new SMBIOS table entry
+ //
+ SmbiosUpdateStructureBuffer (
+ StructureNode,
+ RecordData
+ );
+ } else {
+ //
+ // Copy the entire data (including the Smbios structure header),
+ // but preserve the handle that is already allocated.
+ //
+ Handle = StructureNode->Structure->Handle;
+ CopyMem (
+ StructureNode->Structure,
+ RecordData,
+ RecordDataSize
+ );
+ StructureNode->Structure->Handle = Handle;
+ StructureNode->StructureSize = RecordDataSize;
}
- //
- // Copy the entire data (including the Smbios structure header),
- // but preserve the handle that is already allocated.
- //
- Handle = StructureNode->Structure->Handle;
- CopyMem (
- StructureNode->Structure,
- RecordData,
- RecordDataSize
- );
- StructureNode->Structure->Handle = Handle;
- StructureNode->StructureSize = RecordDataSize;
-
if (NewRecordData != NULL) {
FreePool (NewRecordData);
}