提交 eb1d3926 编写于 作者: R 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: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册