Fix the issue that VariablePei hangs on Richford when variable region is wiped out.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7927 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24 2009-03-23 13:16:32 +00:00
parent 261136bc32
commit 33f201a09c
1 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,7 @@
/** @file
Framework PEIM to provide the Variable functionality
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
Copyright (c) 2006 - 2009 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -426,6 +426,14 @@ FindVariable (
Variable = IndexTable->StartPtr;
} else {
VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);
//
// Check if FV header is valid.
//
if (((EFI_FIRMWARE_VOLUME_HEADER *) VariableBase)->Signature != EFI_FVH_SIGNATURE) {
return EFI_UNSUPPORTED;
}
VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \
((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);