Commit 994e0b2c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Jesse Barnes

PCI hotplug: Fix unexpected driver unregister in pciehp_acpi.c

If pcie_ports_disabled is set, pcie_port_service_register() returns
error code and select_detection_mode() should not attempt to
unregister dummy_driver and use dummy_slots.  It should return
PCIEHP_DETECT_ACPI immediately instead.
Reviewed-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent e819eb86
...@@ -115,7 +115,8 @@ static struct pcie_port_service_driver __initdata dummy_driver = { ...@@ -115,7 +115,8 @@ static struct pcie_port_service_driver __initdata dummy_driver = {
static int __init select_detection_mode(void) static int __init select_detection_mode(void)
{ {
struct dummy_slot *slot, *tmp; struct dummy_slot *slot, *tmp;
pcie_port_service_register(&dummy_driver); if (pcie_port_service_register(&dummy_driver))
return PCIEHP_DETECT_ACPI;
pcie_port_service_unregister(&dummy_driver); pcie_port_service_unregister(&dummy_driver);
list_for_each_entry_safe(slot, tmp, &dummy_slots, list) { list_for_each_entry_safe(slot, tmp, &dummy_slots, list) {
list_del(&slot->list); list_del(&slot->list);
......
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