]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
MdeModulePkg: Fix typos in comments and variables
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Driver.c
index 20758d38cfdebe1628e2e170c91bbfd82fd0f0e3..1f1e21c3cb252af02684f2b7e3d4e062cde42c3c 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, 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
@@ -364,10 +364,11 @@ ON_ERROR:
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 Dhcp4DestroyChildEntry (\r
   IN LIST_ENTRY         *Entry,\r
   IN VOID               *Context\r
-)\r
+  )\r
 {\r
   DHCP_PROTOCOL                    *Instance;\r
   EFI_SERVICE_BINDING_PROTOCOL     *ServiceBinding;\r
@@ -530,7 +531,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
@@ -717,6 +718,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