tree fc8e0e366460434b515128a287448fa64d15f105
parent 95920324f51b3a12603cf6d9bacbd831f34c5b60
author Michael Ellerman <[EMAIL PROTECTED]> Tue, 09 Aug 2005 15:20:20 +1000
committer Paul Mackerras <[EMAIL PROTECTED]> Mon, 29 Aug 2005 10:53:38 +1000

[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 <[EMAIL PROTECTED]>

 arch/ppc64/kernel/setup.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>

 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
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -536,15 +536,19 @@ static void __init check_for_initrd(void
 
        DBG(" -> check_for_initrd()\n");
 
-       prop = (u64 *)get_property(of_chosen, "linux,initrd-start", NULL);
-       if (prop != NULL) {
-               initrd_start = (unsigned long)__va(*prop);
-               prop = (u64 *)get_property(of_chosen, "linux,initrd-end", NULL);
+       if (of_chosen) {
+               prop = (u64 *)get_property(of_chosen,
+                               "linux,initrd-start", NULL);
                if (prop != NULL) {
-                       initrd_end = (unsigned long)__va(*prop);
-                       initrd_below_start_ok = 1;
-               } else
-                       initrd_start = 0;
+                       initrd_start = (unsigned long)__va(*prop);
+                       prop = (u64 *)get_property(of_chosen,
+                                       "linux,initrd-end", NULL);
+                       if (prop != NULL) {
+                               initrd_end = (unsigned long)__va(*prop);
+                               initrd_below_start_ok = 1;
+                       } else
+                               initrd_start = 0;
+               }
        }
 
        /* If we were passed an initrd, set the ROOT_DEV properly if the values
-
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

Reply via email to