]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: ae350: Check firmware_fdt_addr header
authorRick Chen <rick@andestech.com>
Thu, 20 Oct 2022 05:56:17 +0000 (13:56 +0800)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 20 Oct 2022 07:26:31 +0000 (15:26 +0800)
Check firmware_fdt_addr header to see if it
is a valid fdt blob.

Signed-off-by: Rick Chen <rick@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
board/AndesTech/ax25-ae350/ax25-ae350.c

index 36f0dd4b0fdd3afb1a58d809e7449b064b988f40..63a966e09248399320f7c3b224e4bf14cbbe5a42 100644 (file)
@@ -60,7 +60,7 @@ void *board_fdt_blob_setup(int *err)
        *err = 0;
 
        if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
-               if (gd->arch.firmware_fdt_addr)
+               if (fdt_magic((uintptr_t)gd->arch.firmware_fdt_addr) == FDT_MAGIC)
                        return (void *)(ulong)gd->arch.firmware_fdt_addr;
        }