Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=75c6d1410caa6fea861ef3802e8b186f7685f235 Commit: 75c6d1410caa6fea861ef3802e8b186f7685f235 Parent: 794b26e0600e3aab399f9d0f225f9e0b8782edbb Author: Cyrill Gorcunov <[EMAIL PROTECTED]> AuthorDate: Tue Nov 20 17:32:19 2007 -0800 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Wed Dec 5 05:37:59 2007 -0800
[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 <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- 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 8c4875b..e587a37 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; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html