From 4f77169c942b10f9b6dc45a3bc4be65a3d086607 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 18 Nov 2023 14:05:01 -0700 Subject: [PATCH] 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 --- boot/bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5