]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PartitionDxe: Add already start check for child hanldes
authorZhichao Gao <zhichao.gao@intel.com>
Thu, 2 Jul 2020 07:31:53 +0000 (15:31 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 15 Jul 2020 01:18:13 +0000 (01:18 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823

The partition binding driver would run serval times during BDS.
If the partition support MBR, it would pass the first connection
in MBR partition child handler. The second connect for the same
device would return already started which would be treated as
not found. And it would continue to run next partition child
handler check. That is incorrect behavior to do next check if one
of the routine functions is passed. It may cause one device
installed serval partition child handle on it.
So treat the EFI_ALREADY_STARTED as EFI_SUCCESS to avoid incorrect
next partition child handle check.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c

index d1c878ad2e7ab3e35b2cbabf76fa5e52ae6f8395..6a43c3cafb23c15130beefd85c41915b20943eab 100644 (file)
@@ -1276,6 +1276,15 @@ PartitionInstallChildHandle (
   } else {\r
     FreePool (Private->DevicePath);\r
     FreePool (Private);\r
+\r
+    //\r
+    // if the Status == EFI_ALREADY_STARTED, it means the child handles\r
+    // are already installed. So return EFI_SUCCESS to avoid do the next\r
+    // partition type check.\r
+    //\r
+    if (Status == EFI_ALREADY_STARTED) {\r
+      Status = EFI_SUCCESS;\r
+    }\r
   }\r
 \r
   return Status;\r