]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootm: Adjust position of unmap_sysmem() in boot_get_kernel()
authorSimon Glass <sjg@chromium.org>
Sat, 18 Nov 2023 21:05:01 +0000 (14:05 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 13 Dec 2023 16:51:24 +0000 (11:51 -0500)
These unmaps should happen regardless of the return value. Move them
before the 'return' statement.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
boot/bootm.c

index 1f3a01994cbe190741b85a9d52c6169b670b5634..6ed60bf050847be9624708ec6abb6e7ed4730b4e 100644 (file)
@@ -222,12 +222,12 @@ static int boot_get_kernel(const char *cmd_name, const char *addr_fit,
                printf("## Booting Android Image at 0x%08lx ...\n", img_addr);
                ret = android_image_get_kernel(boot_img, vendor_boot_img,
                                               images->verify, os_data, os_len);
-               if (ret)
-                       return ret;
                if (IS_ENABLED(CONFIG_CMD_ABOOTIMG)) {
                        unmap_sysmem(vendor_boot_img);
                        unmap_sysmem(boot_img);
                }
+               if (ret)
+                       return ret;
                break;
        }
 #endif