]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fdt: Skip checking FDT if the pointer is NULL
authorSimon Glass <sjg@chromium.org>
Sat, 20 Apr 2013 08:42:46 +0000 (08:42 +0000)
committerTom Rini <trini@ti.com>
Wed, 1 May 2013 15:17:21 +0000 (11:17 -0400)
If we have no FDT, don't attempt to read from it. This allows sandbox to
run without an FDT if required.

Signed-off-by: Simon Glass <sjg@chromium.org>
lib/fdtdec.c

index 60369fbc573f63592eeb57f54f2845cf2bb2b252..ac1fe0be20dc2915038b67318f15d88746e354e1 100644 (file)
@@ -354,7 +354,8 @@ int fdtdec_check_fdt(void)
  */
 int fdtdec_prepare_fdt(void)
 {
-       if (((uintptr_t)gd->fdt_blob & 3) || fdt_check_header(gd->fdt_blob)) {
+       if (!gd->fdt_blob || ((uintptr_t)gd->fdt_blob & 3) ||
+           fdt_check_header(gd->fdt_blob)) {
                printf("No valid FDT found - please append one to U-Boot "
                        "binary, use u-boot-dtb.bin or define "
                        "CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>\n");