@retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
@retval EFI_SUCCESS Successfully read volume header to the allocated\r
buffer.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
\r
**/\r
EFI_STATUS\r
return Status;\r
}\r
\r
+ //\r
+ // Validate FV Header signature, if not as expected, continue.\r
+ //\r
+ if (TempFvh.Signature != EFI_FVH_SIGNATURE) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Check to see that the file system is indeed formatted in a way we can\r
+ // understand it...\r
+ //\r
+ if ((!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
+ (!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
//\r
// Allocate a buffer for the caller\r
//\r
}\r
ASSERT (FwVolHeader != NULL);\r
\r
- //\r
- // Validate FV Header signature, if not as expected, continue.\r
- //\r
- if (FwVolHeader->Signature != EFI_FVH_SIGNATURE) {\r
- CoreFreePool (FwVolHeader);\r
- continue;\r
- }\r
-\r
if (!VerifyFvHeaderChecksum (FwVolHeader)) {\r
CoreFreePool (FwVolHeader);\r
continue;\r
}\r
\r
-\r
- //\r
- // Check to see that the file system is indeed formatted in a way we can\r
- // understand it...\r
- //\r
- if ((!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
- (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
- continue;\r
- }\r
-\r
//\r
// Check if there is an FV protocol already installed in that handle\r
//\r