Index: FwVol.c
===================================================================
--- FwVol.c	(revision 16230)
+++ FwVol.c	(working copy)
@@ -200,6 +200,22 @@
   }
 
   //
+  // Validate FV Header signature, if not as expected, continue.
+  //
+  if (TempFvh.Signature != EFI_FVH_SIGNATURE) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Check to see that the file system is indeed formatted in a way we can
+  // understand it...
+  //
+  if ((!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&
+      (!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
   // Allocate a buffer for the caller
   //
   *FwVolHeader = AllocatePool (TempFvh.HeaderLength);
@@ -658,30 +674,12 @@
     }
     ASSERT (FwVolHeader != NULL);
 
-    //
-    // Validate FV Header signature, if not as expected, continue.
-    //
-    if (FwVolHeader->Signature != EFI_FVH_SIGNATURE) {
-      CoreFreePool (FwVolHeader);
-      continue;
-    }
-
     if (!VerifyFvHeaderChecksum (FwVolHeader)) {
       CoreFreePool (FwVolHeader);
       continue;
     }
 
-
     //
-    // Check to see that the file system is indeed formatted in a way we can
-    // understand it...
-    //
-    if ((!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&
-        (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {
-      continue;
-    }
-
-    //
     // Check if there is an FV protocol already installed in that handle
     //
     Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv);
