]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is valid...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / ArpDxe / ArpDriver.c
index 63c7639adadb0fc22995175dd0833e4b6884df3b..37042d11cd1ebfa6dcc2253307011ab344e30e9a 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   ARP driver functions.\r
   \r
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2011, 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<BR>\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -54,6 +54,14 @@ ArpCreateService (
 \r
   ArpService->Signature = ARP_SERVICE_DATA_SIGNATURE;\r
 \r
+  //\r
+  // Init the lists.\r
+  //\r
+  InitializeListHead (&ArpService->ChildrenList);\r
+  InitializeListHead (&ArpService->PendingRequestTable);\r
+  InitializeListHead (&ArpService->DeniedCacheTable);\r
+  InitializeListHead (&ArpService->ResolvedCacheTable);\r
+\r
   //\r
   // Init the servicebinding protocol members.\r
   //\r
@@ -168,17 +176,6 @@ ArpCreateService (
                   TimerPeriodic,\r
                   ARP_PERIODIC_TIMER_INTERVAL\r
                   );\r
-  if (EFI_ERROR (Status)) {\r
-    goto ERROR_EXIT;\r
-  }\r
-\r
-  //\r
-  // Init the lists.\r
-  //\r
-  InitializeListHead (&ArpService->ChildrenList);\r
-  InitializeListHead (&ArpService->PendingRequestTable);\r
-  InitializeListHead (&ArpService->DeniedCacheTable);\r
-  InitializeListHead (&ArpService->ResolvedCacheTable);\r
 \r
 ERROR_EXIT:\r
 \r
@@ -401,7 +398,7 @@ ERROR:
   // On error, clean the arp service context data, and free the memory allocated.\r
   //\r
   ArpCleanService (ArpService);\r
-  gBS->FreePool (ArpService);\r
+  FreePool (ArpService);\r
 \r
   return Status;\r
 }\r
@@ -493,7 +490,7 @@ ArpDriverBindingStop (
     //\r
     ArpCleanService (ArpService);\r
 \r
-    gBS->FreePool (ArpService);\r
+    FreePool (ArpService);\r
   } else {\r
 \r
     while (!IsListEmpty (&ArpService->ChildrenList)) {\r
@@ -576,7 +573,7 @@ ArpServiceBindingCreateChild (
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "ArpSBCreateChild: faild to install ARP protocol, %r.\n", Status));\r
 \r
-    gBS->FreePool (Instance);\r
+    FreePool (Instance);\r
     return Status;\r
   }\r
 \r
@@ -631,7 +628,7 @@ ERROR:
     //\r
     // Free the allocated memory.\r
     //\r
-    gBS->FreePool (Instance);\r
+    FreePool (Instance);\r
   }\r
 \r
   return Status;\r
@@ -651,7 +648,7 @@ ERROR:
   @retval EFI_SUCCES            The protocol was removed from ChildHandle.\r
   @retval EFI_UNSUPPORTED       ChildHandle does not support the protocol that is \r
                                 being removed.\r
-  @retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.\r
+  @retval EFI_INVALID_PARAMETER Child handle is NULL.\r
   @retval EFI_ACCESS_DENIED     The protocol could not be removed from the ChildHandle\r
                                 because its services are being used.\r
   @retval other                 The child handle was not destroyed\r
@@ -751,7 +748,7 @@ ArpServiceBindingDestroyChild (
 \r
   gBS->RestoreTPL (OldTpl);\r
 \r
-  gBS->FreePool (Instance);\r
+  FreePool (Instance);\r
 \r
   return Status;\r
 }\r