summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.c7
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.c b/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.c
index 744a7e3..0525410 100644
--- a/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.c
+++ b/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -1260,6 +1260,11 @@ Undi16SimpleNetworkLoadUndi (
if (!EFI_ERROR (Status)) {
return EFI_SUCCESS;
}
+
+ //
+ // Free resources allocated in LaunchBaseCode
+ //
+ Undi16SimpleNetworkUnloadUndi (SimpleNetworkDevice);
}
return EFI_NOT_FOUND;
diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c b/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c
index 0b3543e..243048c 100644
--- a/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c
+++ b/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c
@@ -1,7 +1,7 @@
/** @file
Helper Routines that use a PXE-enabled NIC option ROM.
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -743,6 +743,11 @@ LaunchBaseCode (
InOutRegs.X.AX)
);
+ if ((UndiLoaderTable->Status != 0) || (InOutRegs.X.AX != PXENV_EXIT_SUCCESS)) {
+ DEBUG ((DEBUG_NET, "LaunchBaseCode exits with error, RomAddress = 0x%X\n\r", RomAddress));
+ return EFI_ABORTED;
+ }
+
DEBUG ((DEBUG_NET, "Now returned from the UNDI code\n\r"));
DEBUG ((DEBUG_NET, "After the call, we have...\n\r"));
@@ -755,8 +760,9 @@ LaunchBaseCode (
Pxe = (PXE_T *)(UINTN)((UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset);
SimpleNetworkDevice->Nii.Id = (UINT64)(UINTN) Pxe;
+ gBS->FreePool (Buffer);
+
//
- // FreePool (Buffer);
// paranoia - make sure a valid !PXE structure
//
if (CompareMem (Pxe->Signature, PXE_SIG, sizeof Pxe->Signature) != 0) {