Fix K8 check error.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7849 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-03-10 08:40:29 +00:00
parent 4941d8817d
commit f0480ecf80
2 changed files with 8 additions and 14 deletions

View File

@ -451,7 +451,9 @@ FtwWrite (
Record->Offset = Offset; Record->Offset = Offset;
Record->Length = Length; Record->Length = Length;
Record->FvBaseAddress = FvbPhysicalAddress; Record->FvBaseAddress = FvbPhysicalAddress;
CopyMem ((Record + 1), PrivateData, Header->PrivateDataSize); if (PrivateData != NULL) {
CopyMem ((Record + 1), PrivateData, Header->PrivateDataSize);
}
MyOffset = (UINT8 *) Record - FtwDevice->FtwWorkSpace; MyOffset = (UINT8 *) Record - FtwDevice->FtwWorkSpace;
MyLength = RECORD_SIZE (Header->PrivateDataSize); MyLength = RECORD_SIZE (Header->PrivateDataSize);
@ -828,22 +830,14 @@ FtwGetLastWrite (
// If this record SpareComplete has not set, then it can not restart. // If this record SpareComplete has not set, then it can not restart.
// //
if (Record->SpareComplete != FTW_VALID_STATE) { if (Record->SpareComplete != FTW_VALID_STATE) {
if (IsFirstRecordOfWrites (Header, Record)) { Status = GetPreviousRecordOfWrites (Header, &Record);
// if (EFI_ERROR (Status)) {
// The First record cannot be restart and target is still healthy,
// so abort() is a safe solution.
//
FtwAbort (This); FtwAbort (This);
*Complete = TRUE; *Complete = TRUE;
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} else {
//
// Step back to the previous record
//
GetPreviousRecordOfWrites (Header, &Record);
} }
} }
// //
// Fill all the requested values // Fill all the requested values
// //

View File

@ -2051,7 +2051,7 @@ FvbNotificationEvent (
// //
// Get the FVB to access variable store // Get the FVB to access variable store
// //
for (Index = 0; Index < HandleCount; Index += 1, Status = EFI_NOT_FOUND) { for (Index = 0; Index < HandleCount; Index += 1, Status = EFI_NOT_FOUND, Fvb = NULL) {
Status = gBS->HandleProtocol ( Status = gBS->HandleProtocol (
HandleBuffer[Index], HandleBuffer[Index],
&gEfiFirmwareVolumeBlockProtocolGuid, &gEfiFirmwareVolumeBlockProtocolGuid,
@ -2086,7 +2086,7 @@ FvbNotificationEvent (
} }
FreePool (HandleBuffer); FreePool (HandleBuffer);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status) && Fvb != NULL) {
Status = VariableCommonInitialize (Fvb); Status = VariableCommonInitialize (Fvb);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);