Don't install FV protocol on the corrupt FV image.

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
This commit is contained in:
lgao4
2012-02-17 05:04:49 +00:00
parent 28de825561
commit 1f33d18687
3 changed files with 21 additions and 38 deletions

View File

@@ -3,7 +3,7 @@
Layers on top of Firmware Block protocol to produce a file abstraction
of FV based files.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
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
@@ -630,17 +630,24 @@ NotifyFwVolBlock (
FvDevice->FwVolHeader = FwVolHeader;
FvDevice->Fv.ParentHandle = Fvb->ParentHandle;
FvDevice->IsFfs3Fv = CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid);
//
// Install an New FV protocol on the existing handle
//
Status = CoreInstallProtocolInterface (
&Handle,
&gEfiFirmwareVolume2ProtocolGuid,
EFI_NATIVE_INTERFACE,
&FvDevice->Fv
);
ASSERT_EFI_ERROR (Status);
if (!EFI_ERROR (FvCheck (FvDevice))) {
//
// Install an New FV protocol on the existing handle
//
Status = CoreInstallProtocolInterface (
&Handle,
&gEfiFirmwareVolume2ProtocolGuid,
EFI_NATIVE_INTERFACE,
&FvDevice->Fv
);
ASSERT_EFI_ERROR (Status);
} else {
//
// Free FvDevice Buffer for the corrupt FV image.
//
CoreFreePool (FvDevice);
}
}
}