]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg: PciHostBridgeDxe: release resources on driver entry failure
authorLaszlo Ersek <lersek@redhat.com>
Tue, 14 Jul 2015 12:02:15 +0000 (12:02 +0000)
committerlersek <lersek@Edk2>
Tue, 14 Jul 2015 12:02:15 +0000 (12:02 +0000)
commit7ee9dc232114206bdfe9c9e5f4d8eb5ed1c917c9
tree948b53146bfeb70b4329775fa67f07dad2c7dab5
parentf5f9496c79e2b82002b32323f1d25ca6df6e7c8a
OvmfPkg: PciHostBridgeDxe: release resources on driver entry failure

The entry point of the driver, InitializePciHostBridge(), leaks resources
(and installed protocols) in the following cases:

- The first root bridge protocol installation fails. In this case, the
  host bridge protocol is left installed, but the driver exits with an
  error.

- The second or a later root bridge protocol installation fails. In this
  case, the host bridge protocol, and all prior root bridge protocols, are
  left installed, even though the driver exits with an error.

Handle errors correctly: roll back / release / uninstall resources when
aborting the driver.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17959 6f19259b-4bc3-4df7-8a09-765794883524
OvmfPkg/PciHostBridgeDxe/PciHostBridge.c