[PATCH v2 14/32] bootm: Adjust position of unmap_sysmem() in boot_get_kernel()

Simon Glass sjg at chromium.org
Thu Nov 16 05:10:14 CET 2023


These unmaps should happen regardless of the return value. Move them
before the 'return' statement.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2:
- Add new patch to adjust position of unmap_sysmem() in boot_get_kernel()

 boot/bootm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 1f3a01994cbe..6ed60bf05084 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.43.0.rc0.421.g78406f8d94-goog



More information about the U-Boot mailing list