diff options
author | John Rose <johnrose@austin.ibm.com> | 2005-11-02 11:29:55 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-03 00:53:49 -0500 |
commit | 8902e87f1fc72740a40686a31ca07e6c2cf1f0f2 (patch) | |
tree | 17d6fa17cbf41c5eda3d79696e77f9a69fa0b51a | |
parent | f4fcbbe9a7fdf11305fea657202b954bdc2228ec (diff) |
[PATCH] ppc64: Fix add notifier crashes
The extraction of PCI stuff from struct device_node left some false
assumptions in notifier code. As a result, dynamic add crashes when
non-PCI nodes are added. This patch fixes these assumptions.
Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/pci_dn.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 9e90d41131d8..a73faafaac8c 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -498,7 +498,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti | |||
498 | 498 | ||
499 | switch (action) { | 499 | switch (action) { |
500 | case PSERIES_RECONFIG_REMOVE: | 500 | case PSERIES_RECONFIG_REMOVE: |
501 | if (pci->iommu_table && | 501 | if (pci && pci->iommu_table && |
502 | get_property(np, "ibm,dma-window", NULL)) | 502 | get_property(np, "ibm,dma-window", NULL)) |
503 | iommu_free_table(np); | 503 | iommu_free_table(np); |
504 | break; | 504 | break; |
diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c index 493bbe43f5b4..1a443a7ada4c 100644 --- a/arch/ppc64/kernel/pci_dn.c +++ b/arch/ppc64/kernel/pci_dn.c | |||
@@ -181,13 +181,14 @@ EXPORT_SYMBOL(fetch_dev_dn); | |||
181 | static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node) | 181 | static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node) |
182 | { | 182 | { |
183 | struct device_node *np = node; | 183 | struct device_node *np = node; |
184 | struct pci_dn *pci; | 184 | struct pci_dn *pci = NULL; |
185 | int err = NOTIFY_OK; | 185 | int err = NOTIFY_OK; |
186 | 186 | ||
187 | switch (action) { | 187 | switch (action) { |
188 | case PSERIES_RECONFIG_ADD: | 188 | case PSERIES_RECONFIG_ADD: |
189 | pci = np->parent->data; | 189 | pci = np->parent->data; |
190 | update_dn_pci_info(np, pci->phb); | 190 | if (pci) |
191 | update_dn_pci_info(np, pci->phb); | ||
191 | break; | 192 | break; |
192 | default: | 193 | default: |
193 | err = NOTIFY_DONE; | 194 | err = NOTIFY_DONE; |