]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ACPICA: Update handling of PCI ID lists.
authorDavid E. Box <david.e.box@linux.intel.com>
Wed, 30 Apr 2014 02:04:20 +0000 (10:04 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 May 2014 22:55:00 +0000 (00:55 +0200)
More of a style cleanup. If hw_build_pci_list 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.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/hwpci.c

index e701d8c33dbfb376b6683b4357a4a268f41f659a..6aade8e1d2a1fcaccd3cf8add36b6f97d2164049 100644 (file)
@@ -140,11 +140,12 @@ acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
                /* Walk the list, updating the PCI device/function/bus numbers */
 
                status = acpi_hw_process_pci_list(pci_id, list_head);
-       }
 
-       /* Always delete the list */
+               /* Delete the list */
+
+               acpi_hw_delete_pci_list(list_head);
+       }
 
-       acpi_hw_delete_pci_list(list_head);
        return_ACPI_STATUS(status);
 }
 
@@ -187,6 +188,10 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device,
        while (1) {
                status = acpi_get_parent(current_device, &parent_device);
                if (ACPI_FAILURE(status)) {
+
+                       /* Must delete the list before exit */
+
+                       acpi_hw_delete_pci_list(*return_list_head);
                        return (status);
                }
 
@@ -199,6 +204,10 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device,
 
                list_element = ACPI_ALLOCATE(sizeof(struct acpi_pci_device));
                if (!list_element) {
+
+                       /* Must delete the list before exit */
+
+                       acpi_hw_delete_pci_list(*return_list_head);
                        return (AE_NO_MEMORY);
                }