Status = BdsLibUpdateFvFileDevicePath (&DevicePath, &gEfiShellFileGuid);\r
if (!EFI_ERROR(Status)) {\r
if (Option->DevicePath != NULL) {\r
- SafeFreePool(Option->DevicePath);\r
+ FreePool(Option->DevicePath);\r
}\r
Option->DevicePath = AllocateZeroPool (GetDevicePathSize (DevicePath));\r
CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath));\r
//\r
// free the temporary device path created by BdsLibUpdateFvFileDevicePath()\r
//\r
- SafeFreePool (DevicePath); \r
+ FreePool (DevicePath); \r
DevicePath = Option->DevicePath;\r
}\r
\r
// Come here means the first instance is not matched\r
//\r
NeedAdjust = TRUE;\r
- SafeFreePool(Instance);\r
+ FreePool(Instance);\r
} while (TempNewDevicePath != NULL);\r
\r
if (DeviceExist) {\r
//\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, Instance );\r
- SafeFreePool (TempNewDevicePath);\r
+ FreePool (TempNewDevicePath);\r
\r
//\r
// Second, append the remaining parth after the matched instance\r
//\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = AppendDevicePathInstance (Instance, CachedDevicePath );\r
- SafeFreePool (TempNewDevicePath);\r
+ FreePool (TempNewDevicePath);\r
//\r
// Save the matching Device Path so we don't need to do a connect all next time\r
//\r
);\r
}\r
\r
- SafeFreePool (Instance);\r
- SafeFreePool (CachedDevicePath);\r
+ FreePool (Instance);\r
+ FreePool (CachedDevicePath);\r
return FullDevicePath;\r
}\r
}\r
if (BdsLibMatchDevicePaths (CachedDevicePath, BlockIoDevicePath)) {\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);\r
- SafeFreePool(TempNewDevicePath);\r
+ FreePool(TempNewDevicePath);\r
\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
- SafeFreePool(TempNewDevicePath);\r
+ FreePool(TempNewDevicePath);\r
} else {\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
- SafeFreePool(TempNewDevicePath);\r
+ FreePool(TempNewDevicePath);\r
}\r
//\r
// Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller\r
}\r
}\r
\r
- SafeFreePool (CachedDevicePath);\r
- SafeFreePool (BlockIoBuffer);\r
+ FreePool (CachedDevicePath);\r
+ if (BlockIoBuffer != NULL) {\r
+ FreePool (BlockIoBuffer);\r
+ }\r
return FullDevicePath;\r
}\r
\r
);\r
\r
if (BootOptionVar == NULL) {\r
- SafeFreePool (BootOrder);\r
+ FreePool (BootOrder);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
if ((OptionDevicePathSize == DevicePathSize) &&\r
(CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {\r
BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
break;\r
}\r
\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
Index++;\r
}\r
\r
BootOrder\r
);\r
\r
- SafeFreePool (BootOrder);\r
+ FreePool (BootOrder);\r
\r
return Status;\r
}\r
&BootOptionSize\r
);\r
if (NULL == BootOptionVar) {\r
- SafeFreePool (BootOrder);\r
+ FreePool (BootOrder);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
//\r
if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&\r
(DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
Index++;\r
continue;\r
}\r
BootOrder[Index] = 0xffff;\r
}\r
\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
Index++;\r
}\r
\r
BootOrder\r
);\r
\r
- SafeFreePool (BootOrder);\r
+ FreePool (BootOrder);\r
\r
return Status;\r
}\r
}\r
\r
if (NumberBlockIoHandles != 0) {\r
- SafeFreePool (BlockIoHandles);\r
+ FreePool (BlockIoHandles);\r
}\r
\r
//\r
}\r
\r
if (NumberFileSystemHandles != 0) {\r
- SafeFreePool (FileSystemHandles);\r
+ FreePool (FileSystemHandles);\r
}\r
\r
//\r
}\r
\r
if (NumberSimpleNetworkHandles != 0) {\r
- SafeFreePool (SimpleNetworkHandles);\r
+ FreePool (SimpleNetworkHandles);\r
}\r
\r
//\r
}\r
\r
if (FvHandleCount != 0) {\r
- SafeFreePool (FvHandleBuffer);\r
+ FreePool (FvHandleBuffer);\r
}\r
//\r
// Make sure every boot only have one time\r
BlockIo->Media->BlockSize,\r
Buffer\r
);\r
- SafeFreePool(Buffer);\r
+ FreePool(Buffer);\r
}\r
}\r
\r
// Try to locate the USB node device path first, if fail then use its previour PCI node to search\r
//\r
DupDevicePath = DuplicateDevicePath (DevicePath);\r
+ ASSERT (DupDevicePath != NULL);\r
+ \r
UpdatedDevicePath = DupDevicePath;\r
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);\r
//\r
}\r
}\r
\r
- SafeFreePool(DupDevicePath);\r
+ FreePool(DupDevicePath);\r
\r
- SafeFreePool(SimpleFileSystemHandles);\r
+ if (SimpleFileSystemHandles != NULL) {\r
+ FreePool(SimpleFileSystemHandles);\r
+ }\r
\r
return ReturnHandle;\r
}\r
return TRUE;\r
} else {\r
if (Status == EFI_SUCCESS) {\r
- SafeFreePool (TempDevicePath); \r
+ FreePool (TempDevicePath); \r
}\r
return FALSE;\r
}\r
FoundFvHandle = FvHandleBuffer[Index];\r
break;\r
}\r
- \r
- SafeFreePool (FvHandleBuffer); \r
+\r
+ if (FvHandleBuffer != NULL) {\r
+ FreePool (FvHandleBuffer); \r
+ }\r
}\r
\r
if (FindFvFile) {\r