]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
OvmfPkg: PciHostBridgeLib: implement PciHostBridgeFreeRootBridges()
[mirror_edk2.git] / OvmfPkg / Library / PciHostBridgeLib / PciHostBridgeLib.c
index 2f22d637ae262f7d42b23bf67ff944d7b615c220..25746dd1cfd0c2040a47221478fd21d62d506a8a 100644 (file)
@@ -215,7 +215,17 @@ PciHostBridgeFreeRootBridges (
   UINTN           Count\r
   )\r
 {\r
-  return;\r
+  if (Bridges == NULL && Count == 0) {\r
+    return;\r
+  }\r
+  ASSERT (Bridges != NULL && Count > 0);\r
+\r
+  do {\r
+    --Count;\r
+    UninitRootBridge (&Bridges[Count]);\r
+  } while (Count > 0);\r
+\r
+  FreePool (Bridges);\r
 }\r
 \r
 \r