[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>

authored by

Michael Ellerman and committed by
Paul Mackerras
9a5573e3 95920324

+12 -8
+12 -8
arch/ppc64/kernel/setup.c
··· 536 536 537 537 DBG(" -> check_for_initrd()\n"); 538 538 539 - prop = (u64 *)get_property(of_chosen, "linux,initrd-start", NULL); 540 - if (prop != NULL) { 541 - initrd_start = (unsigned long)__va(*prop); 542 - prop = (u64 *)get_property(of_chosen, "linux,initrd-end", NULL); 539 + if (of_chosen) { 540 + prop = (u64 *)get_property(of_chosen, 541 + "linux,initrd-start", NULL); 543 542 if (prop != NULL) { 544 - initrd_end = (unsigned long)__va(*prop); 545 - initrd_below_start_ok = 1; 546 - } else 547 - initrd_start = 0; 543 + initrd_start = (unsigned long)__va(*prop); 544 + prop = (u64 *)get_property(of_chosen, 545 + "linux,initrd-end", NULL); 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 554 /* If we were passed an initrd, set the ROOT_DEV properly if the values