aboutsummaryrefslogtreecommitdiff
path: root/source/components/hardware/hwpci.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/hardware/hwpci.c')
-rw-r--r--source/components/hardware/hwpci.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/components/hardware/hwpci.c b/source/components/hardware/hwpci.c
index 08e5ecc18903..86017ed4d47a 100644
--- a/source/components/hardware/hwpci.c
+++ b/source/components/hardware/hwpci.c
@@ -161,11 +161,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);
}
@@ -213,6 +214,9 @@ AcpiHwBuildPciList (
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (Status);
}
@@ -227,6 +231,9 @@ AcpiHwBuildPciList (
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (AE_NO_MEMORY);
}