* [PATCH] powerpc/iseries: fix possible null pointer dereference in iSeries_pcibios_fixup_resources
@ 2010-06-16 15:16 Denis Kirjanov
0 siblings, 0 replies; only message in thread
From: Denis Kirjanov @ 2010-06-16 15:16 UTC (permalink / raw)
To: benh, sfr; +Cc: linuxppc-dev, anton
I don't know if this is a right fix for the problem
since of_get_property can return NULL.
Since iseries_device_information is used only for informational purpose,
we can skip this function without valid HvSubBusNumber number.
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
arch/powerpc/platforms/iseries/pci.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 3fc2e64..ab3962b 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -445,7 +445,11 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
}
allocate_device_bars(pdev);
- iseries_device_information(pdev, bus, *sub_bus);
+ if (likely(sub_bus))
+ iseries_device_information(pdev, bus, *sub_bus);
+ else
+ printk(KERN_ERR "PCI: Device node %s has missing or invalid "
+ "linux,subbus property\n", node->full_name);
}
/*
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-16 15:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-16 15:16 [PATCH] powerpc/iseries: fix possible null pointer dereference in iSeries_pcibios_fixup_resources Denis Kirjanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).