From: Simon Glass Date: Sat, 18 Nov 2023 21:05:02 +0000 (-0700) Subject: bootm: Use the error return from boot_get_kernel() X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=4c76f5e49a499219cde94de5d0b0e007d3d70f79;p=u-boot.git bootm: Use the error return from boot_get_kernel() Rather than looking for a zero-sized image, use the error code returned to determine if things are OK. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/boot/bootm.c b/boot/bootm.c index 6ed60bf050..a23c791a9e 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -324,9 +324,9 @@ 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(cmdtp->name, 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"); + &os_hdr); + if (ret) { + printf("ERROR %dE: can't get kernel image!\n", ret); return 1; }