\r
ON_ERROR:\r
Dhcp4CloseService (DhcpSb);\r
- gBS->FreePool (DhcpSb);\r
+ FreePool (DhcpSb);\r
\r
return Status;\r
}\r
\r
ON_ERROR:\r
Dhcp4CloseService (DhcpSb);\r
- gBS->FreePool (DhcpSb);\r
+ FreePool (DhcpSb);\r
return Status;\r
}\r
\r
\r
Dhcp4CloseService (DhcpSb);\r
\r
- gBS->FreePool (DhcpSb);\r
+ FreePool (DhcpSb);\r
} else {\r
//\r
// Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestoryChild\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (Instance);\r
+ FreePool (Instance);\r
return Status;\r
}\r
\r
NULL\r
);\r
\r
- gBS->FreePool (Instance);\r
+ FreePool (Instance);\r
return Status;\r
}\r
\r
\r
gBS->RestoreTPL (OldTpl);\r
\r
- gBS->FreePool (Instance);\r
+ FreePool (Instance);\r
return EFI_SUCCESS;\r
}\r
UINT32 Index;\r
\r
if (Config->DiscoverTimeout != NULL) {\r
- gBS->FreePool (Config->DiscoverTimeout);\r
+ FreePool (Config->DiscoverTimeout);\r
}\r
\r
if (Config->RequestTimeout != NULL) {\r
- gBS->FreePool (Config->RequestTimeout);\r
+ FreePool (Config->RequestTimeout);\r
}\r
\r
if (Config->OptionList != NULL) {\r
for (Index = 0; Index < Config->OptionCount; Index++) {\r
if (Config->OptionList[Index] != NULL) {\r
- gBS->FreePool (Config->OptionList[Index]);\r
+ FreePool (Config->OptionList[Index]);\r
}\r
}\r
\r
- gBS->FreePool (Config->OptionList);\r
+ FreePool (Config->OptionList);\r
}\r
\r
ZeroMem (Config, sizeof (EFI_DHCP4_CONFIG_DATA));\r
DhcpSb->ActiveChild = NULL;\r
\r
if (Config->DiscoverTimeout != NULL) {\r
- gBS->FreePool (Config->DiscoverTimeout);\r
+ FreePool (Config->DiscoverTimeout);\r
\r
Config->DiscoverTryCount = 0;\r
Config->DiscoverTimeout = NULL;\r
}\r
\r
if (Config->RequestTimeout != NULL) {\r
- gBS->FreePool (Config->RequestTimeout);\r
+ FreePool (Config->RequestTimeout);\r
\r
Config->RequestTryCount = 0;\r
Config->RequestTimeout = NULL;\r
DhcpSb->ServerAddr = 0;\r
\r
if (DhcpSb->LastOffer != NULL) {\r
- gBS->FreePool (DhcpSb->LastOffer);\r
+ FreePool (DhcpSb->LastOffer);\r
DhcpSb->LastOffer = NULL;\r
}\r
\r
if (DhcpSb->Selected != NULL) {\r
- gBS->FreePool (DhcpSb->Selected);\r
+ FreePool (DhcpSb->Selected);\r
DhcpSb->Selected = NULL;\r
}\r
\r
if (DhcpSb->Para != NULL) {\r
- gBS->FreePool (DhcpSb->Para);\r
+ FreePool (DhcpSb->Para);\r
DhcpSb->Para = NULL;\r
}\r
\r
\r
if (Status == EFI_SUCCESS) {\r
if (DhcpSb->LastOffer != NULL) {\r
- gBS->FreePool (DhcpSb->LastOffer);\r
+ FreePool (DhcpSb->LastOffer);\r
}\r
\r
DhcpSb->LastOffer = Packet;\r
\r
} else if (Status == EFI_NOT_READY) {\r
if (DhcpSb->LastOffer != NULL) {\r
- gBS->FreePool (DhcpSb->LastOffer);\r
+ FreePool (DhcpSb->LastOffer);\r
}\r
\r
DhcpSb->LastOffer = Packet;\r
//\r
// OK, get the parameter from server, record the lease\r
//\r
- DhcpSb->Para = AllocatePool (sizeof (DHCP_PARAMETER));\r
-\r
+ DhcpSb->Para = AllocateCopyPool (sizeof (DHCP_PARAMETER), Para);\r
if (DhcpSb->Para == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
\r
DhcpSb->Selected = Packet;\r
- CopyMem (DhcpSb->Para, Para, sizeof (*DhcpSb->Para));\r
-\r
Status = DhcpLeaseAcquired (DhcpSb);\r
-\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
}\r
\r
if (Para != NULL) {\r
- gBS->FreePool (Para);\r
+ FreePool (Para);\r
}\r
\r
Packet = NULL;\r
*OptionPoint = NULL;\r
\r
if (OptNum == 0) {\r
- Status = EFI_NOT_FOUND;\r
goto ON_EXIT;\r
}\r
\r
Status = DhcpIterateOptions (Packet, DhcpFillOption, &Context);\r
\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (Options);\r
+ FreePool (Options);\r
goto ON_EXIT;\r
}\r
\r
*OptionPoint = Options;\r
\r
ON_EXIT:\r
- gBS->FreePool (OptCount);\r
+ FreePool (OptCount);\r
return Status;\r
}\r
\r
if (EFI_ERROR (Status) || (Count == 0)) {\r
return Status;\r
}\r
- \r
+ ASSERT (AllOption != NULL);\r
+\r
Updated = FALSE;\r
ZeroMem (&Parameter, sizeof (Parameter));\r
\r
}\r
\r
if (Updated && (Para != NULL)) {\r
- if ((*Para = AllocatePool (sizeof (DHCP_PARAMETER))) == NULL) {\r
+ *Para = AllocateCopyPool (sizeof (DHCP_PARAMETER), &Parameter);\r
+ if (*Para == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
-\r
- CopyMem (*Para, &Parameter, sizeof (**Para));\r
}\r
\r
ON_EXIT:\r
- gBS->FreePool (AllOption);\r
+ FreePool (AllOption);\r
return Status;\r
}\r
\r
if (EFI_ERROR (Status)) {\r
goto ON_ERROR;\r
}\r
- ASSERT (SeedOptions != NULL);\r
\r
- for (Index = 0; Index < (UINT32) Count; Index++) {\r
- Mark[SeedOptions[Index].Tag] = SeedOptions[Index];\r
+ if (SeedOptions != NULL) {\r
+ for (Index = 0; Index < (UINT32) Count; Index++) {\r
+ Mark[SeedOptions[Index].Tag] = SeedOptions[Index];\r
+ }\r
}\r
\r
//\r
\r
ON_ERROR:\r
if (SeedOptions != NULL) {\r
- gBS->FreePool (SeedOptions);\r
+ FreePool (SeedOptions);\r
}\r
\r
- gBS->FreePool (Mark);\r
+ FreePool (Mark);\r
return Status;\r
}\r
//\r
MnpDeliverPacket (MnpServiceData);\r
\r
- //\r
- // Dispatch the DPC queued by the NotifyFunction of rx token's events.\r
- //\r
- NetLibDispatchDpc ();\r
-\r
EXIT:\r
\r
ASSERT (Nbuf->TotalSize == MnpServiceData->BufferLength);\r
//\r
MnpReceivePacket (MnpServiceData);\r
\r
+ //\r
+ // Dispatch the DPC queued by the NotifyFunction of rx token's events.\r
+ //\r
NetLibDispatchDpc ();\r
}\r
//\r
Status = MnpReceivePacket (Instance->MnpServiceData);\r
\r
+ //\r
+ // Dispatch the DPC queued by the NotifyFunction of rx token's events.\r
+ //\r
NetLibDispatchDpc ();\r
\r
ON_EXIT:\r