boot: image-board: Mismatch a type between variable and return value 43/319943/1
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 5 Nov 2024 09:39:20 +0000 (18:39 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 5 Nov 2024 09:49:01 +0000 (18:49 +0900)
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 <jh80.chung@samsung.com>
boot/image-board.c

index eca1b1d2bffc7a58183d1a78d2902952d0f4a563..62f0f609f561a0bc3c231d9688ca17881d26eca8 100644 (file)
@@ -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 {