]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/GenericBdsLib/BdsConnect.c
DuplicateDevicePath() function use wrong comment same as AppendDevicePath() function.
[mirror_edk2.git] / MdeModulePkg / Library / GenericBdsLib / BdsConnect.c
index 50675429c36ecc2fa011863f8cf97dd0621ff434..edbc3688405ab48275841d824aaa7f1e1c63766f 100644 (file)
@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 /**\r
   This function will connect all the system driver to controller\r
   first, and then special connect the default console, this make\r
-  sure all the system controller avialbe and the platform default\r
+  sure all the system controller available and the platform default\r
   console connected.\r
 \r
 **/\r
@@ -49,13 +49,9 @@ BdsLibConnectAll (
 /**\r
   This function will connect all the system drivers to all controllers\r
   first, and then connect all the console devices the system current\r
-  have. After this we should get all the device work and console avariable\r
+  have. After this we should get all the device work and console available\r
   if the system have console device.\r
 \r
-  None\r
-\r
-  @return None\r
-\r
 **/\r
 VOID\r
 BdsLibGenericConnectAll (\r
@@ -180,7 +176,7 @@ BdsLibConnectDevicePath (
   } while (DevicePath != NULL);\r
 \r
   if (CopyOfDevicePath != NULL) {\r
-    gBS->FreePool (CopyOfDevicePath);\r
+    FreePool (CopyOfDevicePath);\r
   }\r
   //\r
   // All handle with DevicePath exists in the handle database\r
@@ -224,7 +220,9 @@ BdsLibConnectAllEfi (
     Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
   }\r
 \r
-  gBS->FreePool (HandleBuffer);\r
+  if (HandleBuffer != NULL) {\r
+    FreePool (HandleBuffer);\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -267,7 +265,9 @@ BdsLibDisconnectAllEfi (
     Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
   }\r
 \r
-  gBS->FreePool (HandleBuffer);\r
+  if (HandleBuffer != NULL) {\r
+    FreePool (HandleBuffer);\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -309,7 +309,7 @@ BdsLibConnectAllDriversToAllControllers (
 \r
 /**\r
   Connect the specific Usb device which match the short form device path,\r
-  and whose bus is determined by Host Controller (Uhci or Ehci)\r
+  and whose bus is determined by Host Controller (Uhci or Ehci).\r
 \r
   @param  HostControllerPI      Uhci (0x00) or Ehci (0x20) or Both uhci and ehci\r
                                 (0xFF)\r
@@ -317,9 +317,11 @@ BdsLibConnectAllDriversToAllControllers (
                                 element  being a USB WWID or a USB Class device\r
                                 path\r
 \r
-  @return EFI_INVALID_PARAMETER\r
-  @return EFI_SUCCESS\r
-  @return EFI_NOT_FOUND\r
+  @return EFI_INVALID_PARAMETER  RemainingDevicePath is NULL pointer.\r
+                                 RemainingDevicePath is not a USB device path.\r
+                                 Invalid HostControllerPI type.\r
+  @return EFI_SUCCESS            Success to connect USB device\r
+  @return EFI_NOT_FOUND          Fail to find handle for USB controller to connect.\r
 \r
 **/\r
 EFI_STATUS\r