]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 12 Sep 2019 06:34:06 +0000 (14:34 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Feb 2020 14:43:25 +0000 (14:43 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1869

The UEFI spec requires that if any error occurs in
UninstallMultipleProtocolInterfaces(), EFI_INVALID_PARAMETER is returned
and not the return code of UninstallProtocolInterface().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
MdeModulePkg/Core/Dxe/Hand/Handle.c

index b2721b3ab23a4fe0bf92150a0c6167f29a35ff4c..6eccb41ecb5cfcb09a03fcb2e06b26271e43b64d 100644 (file)
@@ -802,20 +802,27 @@ Done:
 \r
 \r
 \r
-\r
 /**\r
   Uninstalls a list of protocol interface in the boot services environment.\r
-  This function calls UnisatllProtocolInterface() in a loop. This is\r
+  This function calls UninstallProtocolInterface() in a loop. This is\r
   basically a lib function to save space.\r
 \r
-  @param  Handle                 The handle to uninstall the protocol\r
+  If any errors are generated while the protocol interfaces are being\r
+  uninstalled, then the protocol interfaces uninstalled prior to the error will\r
+  be reinstalled and EFI_INVALID_PARAMETER will be returned.\r
+\r
+  @param  Handle                 The handle to uninstall the protocol interfaces\r
+                                 from.\r
   @param  ...                    EFI_GUID followed by protocol instance. A NULL\r
-                                 terminates the  list. The pairs are the\r
+                                 terminates the list. The pairs are the\r
                                  arguments to UninstallProtocolInterface(). All\r
                                  the protocols are added to Handle.\r
 \r
-  @return Status code\r
-\r
+  @retval EFI_SUCCESS            if all protocol interfaces where uninstalled.\r
+  @retval EFI_INVALID_PARAMETER  if any protocol interface could not be\r
+                                 uninstalled and an attempt was made to\r
+                                 reinstall previously uninstalled protocol\r
+                                 interfaces.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -864,6 +871,7 @@ CoreUninstallMultipleProtocolInterfaces (
       CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);\r
     }\r
     VA_END (Args);\r
+    Status = EFI_INVALID_PARAMETER;\r
   }\r
 \r
   return Status;\r