Clean up meta data and code scrub for PCI Bus module.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8624 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2009-06-23 07:19:00 +00:00
parent 03476bf384
commit 48a9ea7b1b
13 changed files with 457 additions and 577 deletions

View File

@ -1224,7 +1224,9 @@ UpdatePciInfo (
Ptr++;
}
gBS->FreePool (Configuration);
if (Configuration != NULL) {
FreePool (Configuration);
}
return Status;
}
@ -1618,24 +1620,13 @@ CreatePciIoDevice (
UINT8 Func
)
{
EFI_STATUS Status;
PCI_IO_DEVICE *PciIoDevice;
PciIoDevice = NULL;
Status = gBS->AllocatePool (
EfiBootServicesData,
sizeof (PCI_IO_DEVICE),
(VOID **) &PciIoDevice
);
if (EFI_ERROR (Status)) {
PciIoDevice = AllocateZeroPool (sizeof (PCI_IO_DEVICE));
if (PciIoDevice == NULL) {
return NULL;
}
ZeroMem (PciIoDevice, sizeof (PCI_IO_DEVICE));
PciIoDevice->Signature = PCI_IO_DEVICE_SIGNATURE;
PciIoDevice->Handle = NULL;
PciIoDevice->PciRootBridgeIo = PciRootBridgeIo;
@ -1644,6 +1635,7 @@ CreatePciIoDevice (
PciIoDevice->DeviceNumber = Device;
PciIoDevice->FunctionNumber = Func;
PciIoDevice->Decodes = 0;
if (gFullEnumeration) {
PciIoDevice->Allocated = FALSE;
} else {
@ -1663,7 +1655,6 @@ CreatePciIoDevice (
//
// Initialize the PCI I/O instance structure
//
InitializePciIoInstance (PciIoDevice);
InitializePciDriverOverrideInstance (PciIoDevice);
InitializePciLoadFile2 (PciIoDevice);