From 5db211d1733b01013ba4927a1fed635892e706a6 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 5 Nov 2024 18:39:20 +0900 Subject: [PATCH] boot: image-board: Mismatch a type between variable and return value phys_addr_t can be used unsigned long long type with CONFIG_PHYS_64BIT. But hextoul() is always returning to unsigned long. It can be assigned to unexpected value. To avoid wrong behavior, change from hextoul() to simple_strtoull(). Fixes: a4df06e41fa2 ("boot: fdt: Change type of env_get_bootm_low() to phys_addr_t") Change-Id: Ia7c25f8fbc8e31bdd7abd1f9cf599c4c873dd769 Signed-off-by: Jaehoon Chung --- boot/image-board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/image-board.c b/boot/image-board.c index eca1b1d2bf..62f0f609f5 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -548,7 +548,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len, /* a value of "no" or a similar string will act like 0, * turning the "load high" feature off. This is intentional. */ - initrd_high = hextoul(s, NULL); + initrd_high = simple_strtoull(s, NULL, 16); if (initrd_high == ~0) initrd_copy_to_ram = 0; } else { -- 2.34.1