/** @file\r
\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
/**\r
Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
- \r
+\r
@param[in] Entry The entry to be removed.\r
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
\r
if (!IsListEmpty (&DhcpSb->Children)) {\r
//\r
// Destroy all the children instances before destory the service.\r
- // \r
+ //\r
List = &DhcpSb->Children;\r
Status = NetDestroyLinkList (\r
List,\r
gDhcpControllerNameTable = NULL;\r
}\r
FreePool (DhcpSb);\r
- \r
+\r
Status = EFI_SUCCESS;\r
}\r
\r
\r
@retval EFI_SUCCES The protocol was added to ChildHandle.\r
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
- @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create\r
the child\r
@retval other The child handle was not created\r
\r
RemoveEntryList (&Instance->Link);\r
DhcpSb->NumChildren--;\r
\r
+ if (Instance->UdpIo != NULL) {\r
+ UdpIoCleanIo (Instance->UdpIo);\r
+ gBS->CloseProtocol (\r
+ Instance->UdpIo->UdpHandle,\r
+ &gEfiUdp4ProtocolGuid,\r
+ Instance->Service->Image,\r
+ Instance->Handle\r
+ );\r
+ UdpIoFreeIo (Instance->UdpIo);\r
+ Instance->UdpIo = NULL;\r
+ Instance->Token = NULL;\r
+ }\r
+\r
gBS->RestoreTPL (OldTpl);\r
\r
FreePool (Instance);\r