summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-09-26 09:01:23 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-09-26 09:01:23 +0000
commit98b241d634c652bb615e1fd33cc2e4bb8efc7216 (patch)
tree0dec6fd0e0efdf532620c25262bc03490ab66f33 /IntelFrameworkModulePkg
parentc352b29843007c2f70660e4023aef01e5b9ba8f5 (diff)
downloadedk2-platforms-98b241d634c652bb615e1fd33cc2e4bb8efc7216.tar.xz
Remove local function IsValidDevicePath and use new interface provided by UefiDevicePathlib.
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com> Reviewed-by: Eric Dong<eric.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13742 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c52
1 files changed, 1 insertions, 51 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
index def572d2d5..7949d0995f 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -275,56 +275,6 @@ BdsBootDeviceSelect (
}
/**
- Validate the device path instance.
-
- Only base on the length filed in the device path node to validate the device path.
-
- @param DevicePath A pointer to a device path data structure.
- @param MaxSize Max valid device path size. If big than this size,
- return error.
-
- @retval TRUE An valid device path.
- @retval FALSE An invalid device path.
-
-**/
-BOOLEAN
-IsValidDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN UINTN MaxSize
- )
-{
- UINTN Size;
- UINTN NodeSize;
-
- if (DevicePath == NULL) {
- return TRUE;
- }
-
- Size = 0;
-
- while (!IsDevicePathEnd (DevicePath)) {
- NodeSize = DevicePathNodeLength (DevicePath);
- if (NodeSize < END_DEVICE_PATH_LENGTH) {
- return FALSE;
- }
-
- Size += NodeSize;
- if (Size > MaxSize) {
- return FALSE;
- }
-
- DevicePath = NextDevicePathNode (DevicePath);
- }
-
- Size += DevicePathNodeLength (DevicePath);
- if (Size > MaxSize) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
Validate input console variable data.
@@ -347,7 +297,7 @@ BdsFormalizeConsoleVariable (
&gEfiGlobalVariableGuid,
&VariableSize
);
- if (!IsValidDevicePath (DevicePath, VariableSize)) {
+ if ((DevicePath != NULL) && !IsDevicePathValid (DevicePath, VariableSize)) {
Status = gRT->SetVariable (
VariableName,
&gEfiGlobalVariableGuid,