diff options
author | Robert Moore <Robert.Moore@intel.com> | 2014-04-04 14:24:17 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2014-04-04 14:24:17 -0700 |
commit | 8dbec22b278ff9e2a7a534400c558089383f78c5 (patch) | |
tree | c4c3c1b933c9285d1a1d5c4594031ecde1509238 /source | |
parent | 4d5366e232a382cf82dbd067a21ae7258d7c2b32 (diff) | |
download | acpica-8dbec22b278ff9e2a7a534400c558089383f78c5.tar.gz |
Update handling of PCI ID lists.
More of a style cleanup. if HwBuildPciList is to return a non-zero
status, it now deletes any partial ID list that has been constructed.
if it returns AE_OK, the caller is responsible for list deletion.
David Box.
Diffstat (limited to 'source')
-rw-r--r-- | source/components/hardware/hwpci.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/components/hardware/hwpci.c b/source/components/hardware/hwpci.c index 42b5f592e..24b7c01e9 100644 --- a/source/components/hardware/hwpci.c +++ b/source/components/hardware/hwpci.c @@ -233,11 +233,12 @@ AcpiHwDerivePciId ( /* Walk the list, updating the PCI device/function/bus numbers */ Status = AcpiHwProcessPciList (PciId, ListHead); - } - /* Always delete the list */ + /* Delete the list */ + + AcpiHwDeletePciList (ListHead); + } - AcpiHwDeletePciList (ListHead); return_ACPI_STATUS (Status); } @@ -285,6 +286,9 @@ AcpiHwBuildPciList ( Status = AcpiGetParent (CurrentDevice, &ParentDevice); if (ACPI_FAILURE (Status)) { + /* Must delete the list before exit */ + + AcpiHwDeletePciList (*ReturnListHead); return (Status); } @@ -299,6 +303,9 @@ AcpiHwBuildPciList ( ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE)); if (!ListElement) { + /* Must delete the list before exit */ + + AcpiHwDeletePciList (*ReturnListHead); return (AE_NO_MEMORY); } |