[PATCH] ppc64: bugfix: crash on PHB add
[powerpc.git] / drivers / pci / hotplug / rpadlpar_core.c
index fcb66b9..e8593a6 100644 (file)
@@ -306,7 +306,7 @@ static int dlpar_add_phb(char *drc_name, struct device_node *dn)
 {
        struct pci_controller *phb;
 
-       if (PCI_DN(dn)->phb) {
+       if (PCI_DN(dn) && PCI_DN(dn)->phb) {
                /* PHB already exists */
                return -EINVAL;
        }