From: Linas Vepstas Date: Fri, 4 Nov 2005 00:51:17 +0000 (-0600) Subject: [PATCH] ppc64: bugfix: crash on PHB add X-Git-Tag: v2.6.15-rc1~51^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fe98aeab8494cf431ef62e080cbe1dc1b6f5bd49;p=linux-2.6-omap-h63xx.git [PATCH] ppc64: bugfix: crash on PHB add 19-rpaphp-crashing.patch This patch fixes a bug related to dlpar PHB add, after a PHB removal. -- The crash was due to the PHB not having a pci_dn structure yet, when the phb is being added. This code survived testing, of adding and removeig the PHB and all slots underneath it, 17 times so far, as of this writing. Signed-off-by: Linas Vepstas Signed-off-by: Paul Mackerras --- diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index fcb66b9a0e2..e8593a60ee8 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c @@ -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; }