[U-Boot] [PATCH 08/12] x86: Initialize the device tree pointer to NULL in i386.

Simon Glass sjg at chromium.org
Sun Oct 21 00:33:12 CEST 2012


From: Gabe Black <gabeblack at chromium.org>

If the device tree pointer isn't set to anything, which could happen if the
device tree isn't found, for instance, or simply never set up, the pointer
could be set to something arbitrary. This change forces initializes it to NULL
so that it's more obviously not set.

Signed-off-by: Gabe Black <gabeblack at chromium.org>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
 arch/x86/cpu/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index e8bfe6f..8b6d4cf 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -93,6 +93,7 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries)
 void init_gd(gd_t *id, u64 *gdt_addr)
 {
 	id->gd_addr = (ulong)id;
+	gd->fdt_blob = NULL;
 	setup_gdt(id, gdt_addr);
 }
 
-- 
1.7.7.3



More information about the U-Boot mailing list