summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-19 06:34:35 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-19 06:34:35 +0000
commit8c80d3942e41325fe0f4dc2f5deea2bd9fda8e53 (patch)
tree8f107abd847b10e62a8ff84b906cad39619133df /MdeModulePkg
parent49fabc83a58379266b99864364a8ed82abeef49c (diff)
downloadedk2-8c80d3942e41325fe0f4dc2f5deea2bd9fda8e53.zip
edk2-8c80d3942e41325fe0f4dc2f5deea2bd9fda8e53.tar.gz
edk2-8c80d3942e41325fe0f4dc2f5deea2bd9fda8e53.tar.bz2
Add some ASSERT()s.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7302 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/GenericBdsLib/BdsBoot.c7
-rw-r--r--MdeModulePkg/Library/GenericBdsLib/BdsMisc.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
index f170daa..953086c 100644
--- a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -89,8 +89,8 @@ BdsLibDoLegacyBoot (
EFI_STATUS
EFIAPI
BdsLibBootViaBootOption (
- IN BDS_COMMON_OPTION * Option,
- IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
+ IN BDS_COMMON_OPTION *Option,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
OUT UINTN *ExitDataSize,
OUT CHAR16 **ExitData OPTIONAL
)
@@ -157,6 +157,7 @@ BdsLibBootViaBootOption (
&Option->BootCurrent
);
+ ASSERT (Option->DevicePath != NULL);
if ((DevicePathType (Option->DevicePath) == BBS_DEVICE_PATH) &&
(DevicePathSubType (Option->DevicePath) == BBS_BBS_DP)
) {
@@ -459,6 +460,7 @@ BdsExpandPartitionPartialDevicePathToFull (
// If the user try to boot many OS in different HDs or partitions, in theory, the 'HDDP' variable maybe become larger and larger.
//
InstanceNum = 0;
+ ASSERT (CachedDevicePath != NULL);
TempNewDevicePath = CachedDevicePath;
while (!IsDevicePathEnd (TempNewDevicePath)) {
TempNewDevicePath = NextDevicePathNode (TempNewDevicePath);
@@ -1225,6 +1227,7 @@ BdsLibBootNext (
//
UnicodeSPrint (Buffer, sizeof (Buffer), L"Boot%04x", *BootNext);
BootOption = BdsLibVariableToOption (&TempList, Buffer);
+ ASSERT (BootOption != NULL);
BdsLibConnectDevicePath (BootOption->DevicePath);
BdsLibBootViaBootOption (BootOption, BootOption->DevicePath, &ExitDataSize, &ExitData);
}
diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
index c968678..5779aec 100644
--- a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
+++ b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
@@ -270,7 +270,7 @@ BdsLibRegisterNewOption (
&gEfiGlobalVariableGuid,
&TempOptionSize
);
-
+ ASSERT (TempOptionPtr != NULL);
//
// Compare with current option variable
//
@@ -600,6 +600,7 @@ BdsLibBuildOptionFromVar (
}
Option = BdsLibVariableToOption (BdsCommonOptionList, OptionName);
+ ASSERT (Option != NULL);
Option->BootCurrent = OptionOrder[Index];
}