]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
bootm: fix flush_cache() with IH_TYPE_KERNEL_NOLOAD
authorNora Schiffer <nora.schiffer@ew.tq-group.com>
Mon, 22 Jun 2026 11:19:31 +0000 (13:19 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 3 Jul 2026 16:11:11 +0000 (10:11 -0600)
`flush_start` must be set after `load` has been assigned.

Fixes: 69544c4fd8b1 ("bootm: Support kernel_noload with compression")
Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
boot/bootm.c

index 4c260a5f5cedb1edf6838876f4a612cbab5744c2..7c9a6f8297604a19f2f1738a92e6f1ad4c52f2c1 100644 (file)
@@ -618,7 +618,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)
        ulong image_start = os.image_start;
        ulong image_len = os.image_len;
        ulong decomp_len = CONFIG_SYS_BOOTM_LEN;
-       ulong flush_start = ALIGN_DOWN(load, ARCH_DMA_MINALIGN);
+       ulong flush_start;
        bool no_overlap;
        void *load_buf, *image_buf;
        int err;
@@ -663,6 +663,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)
        /* We need the decompressed image size in the next steps */
        images->os.image_len = load_end - load;
 
+       flush_start = ALIGN_DOWN(load, ARCH_DMA_MINALIGN);
        flush_cache(flush_start, ALIGN(load_end, ARCH_DMA_MINALIGN) - flush_start);
 
        debug("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load, load_end);