[PATCH] 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 rick@andestech.com --- board/AndesTech/ax25-ae350/ax25-ae350.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c index 36f0dd4..f348066 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(gd->arch.firmware_fdt_addr) == FDT_MAGIC) return (void *)(ulong)gd->arch.firmware_fdt_addr; }

Hi Rick,
On Thu, Oct 13, 2022 at 01:24:20PM +0800, Rick Chen wrote:
Check firmware_fdt_addr header to see if it is a valid fdt blob.
Signed-off-by: Rick Chen rick@andestech.com
board/AndesTech/ax25-ae350/ax25-ae350.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
LGTM! Could you send it again, because I ran into below error and the patch did not seem to apply. ``` Applying: riscv: ae350: Check firmware_fdt_addr header error: git diff header lacks filename information when removing 1 leading pathname component (line 6) Patch failed at 0001 riscv: ae350: Check firmware_fdt_addr header ```
Reviewed-by: Leo Yu-Chi Liang ycliang@andestech.com
Best regards, Leo
participants (2)
-
Leo Liang
-
Rick Chen