[PATCH 13/29] bootm: Use the error return from boot_get_kernel()

Simon Glass sjg at chromium.org
Sun Nov 12 01:08:58 CET 2023


Rather than looking for a zero-sized image, use the error code returned
to determine if things are OK.

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

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

diff --git a/boot/bootm.c b/boot/bootm.c
index 57eaa1ff10df..5e3b5e940734 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -324,8 +324,8 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
 	/* get kernel image header, start address and length */
 	ret = boot_get_kernel("bootm", argv[0], &images, &images.os.image_start,
 			      &images.os.image_len, &os_hdr);
-	if (images.os.image_len == 0) {
-		puts("ERROR: can't get kernel image!\n");
+	if (ret) {
+		printf("ERROR %dE: can't get kernel image!\n", ret);
 		return 1;
 	}
 
-- 
2.42.0.869.gea05f2083d-goog



More information about the U-Boot mailing list