summaryrefslogtreecommitdiff
path: root/source/components/hardware/hwpci.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-05-18 23:17:05 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-05-18 23:17:05 +0000
commit615eb2945402758f050f1cb469181d3d22a22aa3 (patch)
tree0f95f8242a48aa24d8a795f626766746819b5227 /source/components/hardware/hwpci.c
parent2a91972d59fb9df39eae760a853d6f5bc4065cf0 (diff)
Notes
Diffstat (limited to 'source/components/hardware/hwpci.c')
-rw-r--r--source/components/hardware/hwpci.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/components/hardware/hwpci.c b/source/components/hardware/hwpci.c
index 617d5adbdbca..21cc667fa3f6 100644
--- a/source/components/hardware/hwpci.c
+++ b/source/components/hardware/hwpci.c
@@ -140,7 +140,7 @@ AcpiHwDerivePciId (
ACPI_HANDLE PciRegion)
{
ACPI_STATUS Status;
- ACPI_PCI_DEVICE *ListHead = NULL;
+ ACPI_PCI_DEVICE *ListHead;
ACPI_FUNCTION_TRACE (HwDerivePciId);
@@ -198,7 +198,6 @@ AcpiHwBuildPciList (
ACPI_HANDLE ParentDevice;
ACPI_STATUS Status;
ACPI_PCI_DEVICE *ListElement;
- ACPI_PCI_DEVICE *ListHead = NULL;
/*
@@ -206,6 +205,7 @@ AcpiHwBuildPciList (
* a list of device nodes. Loop will exit when either the PCI device is
* found, or the root of the namespace is reached.
*/
+ *ReturnListHead = NULL;
CurrentDevice = PciRegion;
while (1)
{
@@ -222,7 +222,6 @@ AcpiHwBuildPciList (
if (ParentDevice == RootPciDevice)
{
- *ReturnListHead = ListHead;
return (AE_OK);
}
@@ -237,9 +236,9 @@ AcpiHwBuildPciList (
/* Put new element at the head of the list */
- ListElement->Next = ListHead;
+ ListElement->Next = *ReturnListHead;
ListElement->Device = ParentDevice;
- ListHead = ListElement;
+ *ReturnListHead = ListElement;
CurrentDevice = ParentDevice;
}