Signed-off-by: lgao4
Reviewed-by: rsun3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13020
6f19259b-4bc3-4df7-8a09-
765794883524
Layers on top of Firmware Block protocol to produce a file abstraction\r
of FV based files.\r
\r
Layers on top of Firmware Block protocol to produce a file abstraction\r
of FV based files.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
FvDevice->FwVolHeader = FwVolHeader;\r
FvDevice->Fv.ParentHandle = Fvb->ParentHandle;\r
FvDevice->IsFfs3Fv = CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid);\r
FvDevice->FwVolHeader = FwVolHeader;\r
FvDevice->Fv.ParentHandle = Fvb->ParentHandle;\r
FvDevice->IsFfs3Fv = CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid);\r
-\r
- //\r
- // Install an New FV protocol on the existing handle\r
- //\r
- Status = CoreInstallProtocolInterface (\r
- &Handle,\r
- &gEfiFirmwareVolume2ProtocolGuid,\r
- EFI_NATIVE_INTERFACE,\r
- &FvDevice->Fv\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+ \r
+ if (!EFI_ERROR (FvCheck (FvDevice))) {\r
+ //\r
+ // Install an New FV protocol on the existing handle\r
+ //\r
+ Status = CoreInstallProtocolInterface (\r
+ &Handle,\r
+ &gEfiFirmwareVolume2ProtocolGuid,\r
+ EFI_NATIVE_INTERFACE,\r
+ &FvDevice->Fv\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ } else {\r
+ //\r
+ // Free FvDevice Buffer for the corrupt FV image.\r
+ //\r
+ CoreFreePool (FvDevice);\r
+ }\r
/** @file\r
Implements get/set firmware volume attributes\r
\r
/** @file\r
Implements get/set firmware volume attributes\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
FvDevice = FV_DEVICE_FROM_THIS (This);\r
Fvb = FvDevice->Fvb;\r
\r
FvDevice = FV_DEVICE_FROM_THIS (This);\r
Fvb = FvDevice->Fvb;\r
\r
- if (FvDevice->CachedFv == NULL) {\r
- Status = FvCheck (FvDevice);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- }\r
-\r
//\r
// First get the Firmware Volume Block Attributes\r
//\r
//\r
// First get the Firmware Volume Block Attributes\r
//\r
Firmware File System protocol. Layers on top of Firmware\r
Block protocol to produce a file abstraction of FV based files.\r
\r
Firmware File System protocol. Layers on top of Firmware\r
Block protocol to produce a file abstraction of FV based files.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
);\r
\r
OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
);\r
\r
-\r
-\r
-/**\r
- Check if an FV is consistent and allocate cache for it.\r
-\r
- @param FvDevice A pointer to the FvDevice to be checked.\r
-\r
- @retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
- @retval EFI_SUCCESS FV is consistent and cache is allocated.\r
- @retval EFI_VOLUME_CORRUPTED File system is corrupted.\r
-\r
-**/\r
-EFI_STATUS\r
-FvCheck (\r
- IN OUT FV_DEVICE *FvDevice\r
- );\r
-\r