From dc4d64670a19d4f813e8f3dc7231998615404511 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 25 Jan 2016 23:17:22 +0100 Subject: OvmfPkg: PciHostBridgeLib: implement PciHostBridgeFreeRootBridges() This function has no counterpart in OvmfPkg/PciHostBridgeDxe/, but the PciHostBridgeLib class requires it. Cc: Jordan Justen Cc: Ruiyu Ni Cc: Marcel Apfelbaum Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen --- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OvmfPkg') 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); } -- cgit v1.2.3