diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2007-11-21 02:32:19 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-12-05 14:37:59 +0100 |
commit | 75c6d1410caa6fea861ef3802e8b186f7685f235 (patch) | |
tree | 1ffd0155b9fd658df6e63c907aa2da642c0ee39b /arch/sparc64 | |
parent | [SPARC]: Add missing "space" (diff) | |
download | linux-75c6d1410caa6fea861ef3802e8b186f7685f235.tar.xz linux-75c6d1410caa6fea861ef3802e8b186f7685f235.zip |
[SPARC64]: check for possible NULL pointer dereference
This patch adds checking for possible NULL pointer dereference
if of_find_property() failed.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 8c4875bdb4a8..e587a372f3fe 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c @@ -1022,6 +1022,10 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name) } prop = of_find_property(dp, "reg", NULL); + if (!prop) { + prom_printf("SUN4V_PCI: Could not find config registers\n"); + prom_halt(); + } regs = prop->value; devhandle = (regs->phys_addr >> 32UL) & 0x0fffffff; |