Fix compile errors when disabling compile optimization

- 'OpenFile may be used uninitialized' in ExtLib
- 'undefined reference to memcpy' in FatLib
- 'Lasa/Laml may be used uninitialized' in TpmLib
- 'Adjust may be used uninitialized' in Stage2Support

Signed-off-by: Aiden Park <aiden.park@intel.com>
This commit is contained in:
Aiden Park 2019-09-26 16:54:54 -07:00
parent 1c64a2d411
commit b17c6c29b1
4 changed files with 11 additions and 3 deletions

View File

@ -126,7 +126,8 @@ ExtFsOpenFile (
NameBuffer = AllocatePool (NameSize);
Status = UnicodeStrToAsciiStrS (FileName, NameBuffer, NameSize);
if (EFI_ERROR(Status)) {
goto Error;
FreePool (NameBuffer);
return Status;
}
OpenFile = (OPEN_FILE *)AllocatePool (sizeof (OPEN_FILE));

View File

@ -147,7 +147,7 @@ FindFile (
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
} else {
Parent = *File;
CopyMem (&Parent, File, sizeof (PEI_FAT_FILE));
}
}
NodeCurr = NodeNext;

View File

@ -44,6 +44,9 @@ GetTCGLasa (
if (TpmLibData != NULL) {
*Lasa = (UINT32) (TpmLibData->LogAreaStartAddress);
*Laml = TpmLibData->LogAreaMinLength;
} else {
*Lasa = 0;
*Laml = 0;
}
}
@ -376,4 +379,4 @@ TpmLogLocalityEvent (
}
TpmLogEvent ( &PcrEventHdr, (const UINT8 *)&StartupLocalityEvent);
}
}

View File

@ -293,6 +293,10 @@ SplitMemroyMap (
// Payload reserved memory
Adjust = PcdGet32 (PcdPayloadReservedMemSize);
Flag = MEM_MAP_FLAG_PAYLOAD;
break;
default:
Adjust = 0;
break;
}
if (Adjust == 0) {
continue;