]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Udp6Dxe/Udp6Driver.c
ShellPkg/UefiShellAcpiViewCommandLib: Fix VS2017 compilation errors
[mirror_edk2.git] / NetworkPkg / Udp6Dxe / Udp6Driver.c
index a4b1104d2b87dc2beab429a74549232fd279a16e..0647c0214fe67f17c42a906c2d2009458e2eeb90 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Driver Binding functions and Service Binding functions for the Network driver module.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -164,7 +164,6 @@ Udp6DriverBindingStart (
                   );\r
   if (EFI_ERROR (Status)) {\r
     Udp6CleanService (Udp6Service);\r
-    goto EXIT;\r
   }\r
 \r
 EXIT:\r
@@ -178,12 +177,13 @@ EXIT:
 \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
-  @retval EFI_SUCCESS           The entry has been removed successfully.\r
-  @retval Others                Fail to remove the entry.\r
+  @retval EFI_INVALID_PARAMETER  Entry is NULL or Context is NULL.\r
+  @retval EFI_SUCCESS            The entry has been removed successfully.\r
+  @retval Others                 Fail to remove the entry.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -243,12 +243,12 @@ Udp6DriverBindingStop (
   IN  EFI_HANDLE                   *ChildHandleBuffer OPTIONAL\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  EFI_HANDLE                    NicHandle;\r
-  EFI_SERVICE_BINDING_PROTOCOL  *ServiceBinding;\r
-  UDP6_SERVICE_DATA             *Udp6Service;\r
-  LIST_ENTRY                    *List;\r
-  UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context;\r
+  EFI_STATUS                                Status;\r
+  EFI_HANDLE                                NicHandle;\r
+  EFI_SERVICE_BINDING_PROTOCOL              *ServiceBinding;\r
+  UDP6_SERVICE_DATA                         *Udp6Service;\r
+  LIST_ENTRY                                *List;\r
+  UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT  Context;\r
 \r
   //\r
   // Find the NicHandle where UDP6 ServiceBinding Protocol is installed.\r
@@ -290,18 +290,15 @@ Udp6DriverBindingStop (
                NULL\r
                );\r
   } else if (IsListEmpty (&Udp6Service->ChildrenList)) {\r
-    gBS->UninstallMultipleProtocolInterfaces (\r
-           NicHandle,\r
-           &gEfiUdp6ServiceBindingProtocolGuid,\r
-           &Udp6Service->ServiceBinding,\r
-           NULL\r
-           );\r
\r
-    Udp6CleanService (Udp6Service);\r
+    Status = gBS->UninstallMultipleProtocolInterfaces (\r
+               NicHandle,\r
+               &gEfiUdp6ServiceBindingProtocolGuid,\r
+               &Udp6Service->ServiceBinding,\r
+               NULL\r
+               );\r
 \r
+    Udp6CleanService (Udp6Service);\r
     FreePool (Udp6Service);\r
-\r
-    Status = EFI_SUCCESS;\r
   }\r
 \r
   return Status;\r
@@ -408,7 +405,7 @@ Udp6ServiceBindingCreateChild (
   if (EFI_ERROR (Status)) {\r
     goto ON_ERROR;\r
   }\r
-  \r
+\r
   OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
@@ -510,21 +507,30 @@ Udp6ServiceBindingDestroyChild (
   //\r
   // Close the Ip6 protocol on the default IpIo.\r
   //\r
-  gBS->CloseProtocol (\r
-         Udp6Service->IpIo->ChildHandle,\r
-         &gEfiIp6ProtocolGuid,\r
-         gUdp6DriverBinding.DriverBindingHandle,\r
-         Instance->ChildHandle\r
-         );\r
+  Status = gBS->CloseProtocol (\r
+             Udp6Service->IpIo->ChildHandle,\r
+             &gEfiIp6ProtocolGuid,\r
+             gUdp6DriverBinding.DriverBindingHandle,\r
+             Instance->ChildHandle\r
+             );\r
+  if (EFI_ERROR (Status)) {\r
+    Instance->InDestroy = FALSE;\r
+    return Status;\r
+  }\r
+\r
   //\r
   // Close the Ip6 protocol on this instance's IpInfo.\r
   //\r
-  gBS->CloseProtocol (\r
-         Instance->IpInfo->ChildHandle,\r
-         &gEfiIp6ProtocolGuid,\r
-         gUdp6DriverBinding.DriverBindingHandle,\r
-         Instance->ChildHandle\r
-         );\r
+  Status = gBS->CloseProtocol (\r
+             Instance->IpInfo->ChildHandle,\r
+             &gEfiIp6ProtocolGuid,\r
+             gUdp6DriverBinding.DriverBindingHandle,\r
+             Instance->ChildHandle\r
+             );\r
+  if (EFI_ERROR (Status)) {\r
+    Instance->InDestroy = FALSE;\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Uninstall the Udp6Protocol previously installed on the ChildHandle.\r