summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-01-25 23:17:22 +0100
committerLaszlo Ersek <lersek@redhat.com>2016-03-03 18:18:39 +0100
commitdc4d64670a19d4f813e8f3dc7231998615404511 (patch)
tree8c2aeac1da7c07ee0733dd8e974249378313f4e2 /OvmfPkg/Library
parent46e46eaf6215a66e196082a9307b88a78355b073 (diff)
downloadedk2-dc4d64670a19d4f813e8f3dc7231998615404511.tar.gz
edk2-dc4d64670a19d4f813e8f3dc7231998615404511.tar.bz2
edk2-dc4d64670a19d4f813e8f3dc7231998615404511.zip
OvmfPkg: PciHostBridgeLib: implement PciHostBridgeFreeRootBridges()
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>
Diffstat (limited to 'OvmfPkg/Library')
-rw-r--r--OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 2f22d637ae..25746dd1cf 100644
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -215,7 +215,17 @@ PciHostBridgeFreeRootBridges (
UINTN Count
)
{
- return;
+ if (Bridges == NULL && Count == 0) {
+ return;
+ }
+ ASSERT (Bridges != NULL && Count > 0);
+
+ do {
+ --Count;
+ UninitRootBridge (&Bridges[Count]);
+ } while (Count > 0);
+
+ FreePool (Bridges);
}