]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Driver.c
index d1bba3022a04abd31a0c275e6b20dac9f6941baf..e891b68883070733d0e419a97c8e7e32c5c2c202 100644 (file)
@@ -1,13 +1,7 @@
 /** @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
@@ -355,7 +349,7 @@ ON_ERROR:
 \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
@@ -445,7 +439,7 @@ Dhcp4DriverBindingStop (
   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
@@ -481,7 +475,7 @@ Dhcp4DriverBindingStop (
       gDhcpControllerNameTable = NULL;\r
     }\r
     FreePool (DhcpSb);\r
-    \r
+\r
     Status = EFI_SUCCESS;\r
   }\r
 \r
@@ -531,7 +525,7 @@ DhcpInitProtocol (
 \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
@@ -718,6 +712,19 @@ Dhcp4ServiceBindingDestroyChild (
   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