diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-08-09 01:20:20 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:38 -0400 |
commit | 9a5573e378c5c8976c6000a7643b52e2a0481688 (patch) | |
tree | fc8e0e366460434b515128a287448fa64d15f105 /arch | |
parent | 95920324f51b3a12603cf6d9bacbd831f34c5b60 (diff) |
[PATCH] ppc64: Check of_chosen in check_for_initrd()
You can't call get_property() on a NULL node, so check if of_chosen is set
in check_for_initrd().
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
arch/ppc64/kernel/setup.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64/kernel/setup.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index b3ef8df12982..ee3b20de2e7a 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c | |||
@@ -536,15 +536,19 @@ static void __init check_for_initrd(void) | |||
536 | 536 | ||
537 | DBG(" -> check_for_initrd()\n"); | 537 | DBG(" -> check_for_initrd()\n"); |
538 | 538 | ||
539 | prop = (u64 *)get_property(of_chosen, "linux,initrd-start", NULL); | 539 | if (of_chosen) { |
540 | if (prop != NULL) { | 540 | prop = (u64 *)get_property(of_chosen, |
541 | initrd_start = (unsigned long)__va(*prop); | 541 | "linux,initrd-start", NULL); |
542 | prop = (u64 *)get_property(of_chosen, "linux,initrd-end", NULL); | ||
543 | if (prop != NULL) { | 542 | if (prop != NULL) { |
544 | initrd_end = (unsigned long)__va(*prop); | 543 | initrd_start = (unsigned long)__va(*prop); |
545 | initrd_below_start_ok = 1; | 544 | prop = (u64 *)get_property(of_chosen, |
546 | } else | 545 | "linux,initrd-end", NULL); |
547 | initrd_start = 0; | 546 | if (prop != NULL) { |
547 | initrd_end = (unsigned long)__va(*prop); | ||
548 | initrd_below_start_ok = 1; | ||
549 | } else | ||
550 | initrd_start = 0; | ||
551 | } | ||
548 | } | 552 | } |
549 | 553 | ||
550 | /* If we were passed an initrd, set the ROOT_DEV properly if the values | 554 | /* If we were passed an initrd, set the ROOT_DEV properly if the values |