From: Rick Chen Date: Thu, 20 Oct 2022 05:56:17 +0000 (+0800) Subject: riscv: ae350: Check firmware_fdt_addr header X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=b3b44c674a473bdd3d53cf5196fae897107af619;p=u-boot.git riscv: ae350: Check firmware_fdt_addr header Check firmware_fdt_addr header to see if it is a valid fdt blob. Signed-off-by: Rick Chen Reviewed-by: Leo Yu-Chi Liang --- diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c index 36f0dd4b0f..63a966e092 100644 --- a/board/AndesTech/ax25-ae350/ax25-ae350.c +++ b/board/AndesTech/ax25-ae350/ax25-ae350.c @@ -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; }