diff options
author | Shyam Iyer <shyam.iyer.t@gmail.com> | 2011-09-08 17:41:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-09 22:49:58 -0400 |
commit | 5307f6d5fb12fd01f9f321bc4a8fd77e74858647 (patch) | |
tree | fa0087ac08c4a914e8c3456741d57ddf27534b9a /arch/x86/pci/acpi.c | |
parent | a6a5ed0dd36b4977789e888170f96840cc8b4501 (diff) |
Fix pointer dereference before call to pcie_bus_configure_settings
Commit b03e7495a862 ("PCI: Set PCI-E Max Payload Size on fabric")
introduced a potential NULL pointer dereference in calls to
pcie_bus_configure_settings due to attempts to access pci_bus self
variables when the self pointer is NULL.
To correct this, verify that the self pointer in pci_bus is non-NULL
before dereferencing it.
Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: Jon Mason <mason@myri.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/pci/acpi.c')
-rw-r--r-- | arch/x86/pci/acpi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index c95330267f08..039d91315bc5 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -365,8 +365,13 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) | |||
365 | */ | 365 | */ |
366 | if (bus) { | 366 | if (bus) { |
367 | struct pci_bus *child; | 367 | struct pci_bus *child; |
368 | list_for_each_entry(child, &bus->children, node) | 368 | list_for_each_entry(child, &bus->children, node) { |
369 | pcie_bus_configure_settings(child, child->self->pcie_mpss); | 369 | struct pci_dev *self = child->self; |
370 | if (!self) | ||
371 | continue; | ||
372 | |||
373 | pcie_bus_configure_settings(child, self->pcie_mpss); | ||
374 | } | ||
370 | } | 375 | } |
371 | 376 | ||
372 | if (!bus) | 377 | if (!bus) |