diff mbox series

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

Message ID 20231116041043.362055-15-sjg@chromium.org
State Superseded
Delegated to: Tom Rini
Headers show
Series bootm: Refactoring to reduce reliance on CMDLINE (part A) | expand

Commit Message

Simon Glass Nov. 16, 2023, 4:10 a.m. UTC
These unmaps should happen regardless of the return value. Move them
before the 'return' statement.

Signed-off-by: Simon Glass <sjg@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(-)

Comments

Tom Rini Nov. 16, 2023, 3:44 p.m. UTC | #1
On Wed, Nov 15, 2023 at 09:10:14PM -0700, Simon Glass wrote:

> 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>
diff mbox series

Patch

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