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 <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
+3
-3
@@ -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 */
|
/* get kernel image header, start address and length */
|
||||||
ret = boot_get_kernel(cmdtp->name, argv[0], &images,
|
ret = boot_get_kernel(cmdtp->name, argv[0], &images,
|
||||||
&images.os.image_start, &images.os.image_len,
|
&images.os.image_start, &images.os.image_len,
|
||||||
&os_hdr);
|
&os_hdr);
|
||||||
if (images.os.image_len == 0) {
|
if (ret) {
|
||||||
puts("ERROR: can't get kernel image!\n");
|
printf("ERROR %dE: can't get kernel image!\n", ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user