Commit eb1d3926 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI: PCI: Fix device reference counting in acpi_get_pci_dev()

Commit 63f534b8 ("ACPI: PCI: Rework acpi_get_pci_dev()") failed
to reference count the device returned by acpi_get_pci_dev() as
expected by its callers which in some cases may cause device objects
to be dropped prematurely.

Add the missing get_device() to acpi_get_pci_dev().

Fixes: 63f534b8 ("ACPI: PCI: Rework acpi_get_pci_dev()")
Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9abf2313
...@@ -323,6 +323,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle) ...@@ -323,6 +323,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
list_for_each_entry(pn, &adev->physical_node_list, node) { list_for_each_entry(pn, &adev->physical_node_list, node) {
if (dev_is_pci(pn->dev)) { if (dev_is_pci(pn->dev)) {
get_device(pn->dev);
pci_dev = to_pci_dev(pn->dev); pci_dev = to_pci_dev(pn->dev);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment