summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-24 09:39:47 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-24 09:39:47 +0000
commit35c290c5805c4b0266898040e44b905c19aeda3d (patch)
tree8ad88c7613c213f9e90b409923a6b6a2da7735c1 /MdeModulePkg
parent7ec9caab9293a06129cdeceda40db94f0b37eb9e (diff)
downloadedk2-platforms-35c290c5805c4b0266898040e44b905c19aeda3d.tar.xz
do checksum before installing IBFT.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8649 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
index 60a11b2e0d..6d2b184aad 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
@@ -448,6 +448,7 @@ IScsiPublishIbft (
UINTN HandleCount;
EFI_HANDLE *HandleBuffer;
UINT8 *Heap;
+ UINT8 Checksum;
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
if (EFI_ERROR (Status)) {
@@ -481,7 +482,7 @@ IScsiPublishIbft (
//
// Allocate 4k bytes to hold the ACPI table.
//
- Table = AllocatePool (IBFT_MAX_SIZE);
+ Table = AllocateZeroPool (IBFT_MAX_SIZE);
if (Table == NULL) {
return ;
}
@@ -496,6 +497,9 @@ IScsiPublishIbft (
IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);
IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);
+ Checksum = CalculateCheckSum8((UINT8 *)Table, Table->Length);
+ Table->Checksum = Checksum;
+
FreePool (HandleBuffer);
//