]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: PciHostBridgeLib: implement PciHostBridgeFreeRootBridges()
authorLaszlo Ersek <lersek@redhat.com>
Mon, 25 Jan 2016 22:17:22 +0000 (23:17 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 3 Mar 2016 17:18:39 +0000 (18:18 +0100)
This function has no counterpart in OvmfPkg/PciHostBridgeDxe/, but the
PciHostBridgeLib class requires it.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
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