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

mail settings
Submitter Simon Glass
Date Oct. 20, 2012, 10:33 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/192956/
State Not Applicable, archived
Delegated to: Simon Glass
Headers show


Simon Glass - Oct. 20, 2012, 10:33 p.m.
From: Gabe Black <>

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 <>
Signed-off-by: Simon Glass <>
 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);