From: Simon Glass Date: Sat, 18 Nov 2023 21:05:01 +0000 (-0700) Subject: bootm: Adjust position of unmap_sysmem() in boot_get_kernel() X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=4f77169c942b10f9b6dc45a3bc4be65a3d086607;p=u-boot.git bootm: Adjust position of unmap_sysmem() in boot_get_kernel() These unmaps should happen regardless of the return value. Move them before the 'return' statement. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/boot/bootm.c b/boot/bootm.c index 1f3a01994c..6ed60bf050 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -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