powerpc/pci: Don't scan empty slot
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Tue, 3 May 2016 05:41:43 +0000 (15:41 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 11 May 2016 11:54:26 +0000 (21:54 +1000)
commit4a5954ed7726497415ae49204cfc8e38ee8b127e
tree45ef94517c22c7d80cddafe8220d4b14be0026fb
parentcdddc577d956d55a62581ba3681f8ba66eca3873
powerpc/pci: Don't scan empty slot

In hotplug case, function pci_add_pci_devices() is called to rescan
the specified PCI bus, which might not have any child devices. Access
to the PCI bus's child device node will cause kernel crash without
exception.

This adds one more check to skip scanning PCI bus that doesn't have
any subordinate devices from device-tree, in order to avoid kernel
crash.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/pci-hotplug.c