aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-13 18:54:17 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-18 19:04:01 -0500
commitf516bde5122422889398d10e8e746d18860bd42e (patch)
tree787b3c0925924649bf06c6b907a871b3355937ae /drivers/acpi/pci_root.c
parentc1beb0bdb5b3ef670af3ab946434f7fc55d4c7a3 (diff)
ACPI / PCI root: Clear driver_data before failing enumeration
If a PCI host bridge cannot be enumerated due to an error in pci_acpi_scan_root(), its ACPI device object's driver_data field has to be cleared by acpi_pci_root_add() before freeing the object pointed to by that field, or some later acpi_pci_find_root() checks that should fail may succeed and cause quite a bit of confusion to ensue. Fix acpi_pci_root_add() to clear device->driver_data before returning an error code as appropriate. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 417876bce854..b5cb729328a4 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -525,6 +525,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
525 dev_err(&device->dev, 525 dev_err(&device->dev,
526 "Bus %04x:%02x not present in PCI namespace\n", 526 "Bus %04x:%02x not present in PCI namespace\n",
527 root->segment, (unsigned int)root->secondary.start); 527 root->segment, (unsigned int)root->secondary.start);
528 device->driver_data = NULL;
528 result = -ENODEV; 529 result = -ENODEV;
529 goto end; 530 goto end;
530 } 531 }