From: Hannes Schmelzer Date: Thu, 11 Oct 2018 05:44:42 +0000 (+0200) Subject: x86/bootm: fix error handling in boot_prep_linux(...) X-Git-Tag: v2025.01-rc5-pxa1908~3324^2~13 X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=c74e3295ae4a5338f91e971aee1638fa08a9b97d;p=u-boot.git x86/bootm: fix error handling in boot_prep_linux(...) Once we get a zero pointer from load_zimage(...) we must bunch out instead of continue boot. Signed-off-by: Hannes Schmelzer Reviewed-by: Bin Meng --- diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 54c22fe6de..832b1f901c 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -116,6 +116,10 @@ static int boot_prep_linux(bootm_headers_t *images) char *base_ptr; base_ptr = (char *)load_zimage(data, len, &load_address); + if (!base_ptr) { + puts("## Kernel loading failed ...\n"); + goto error; + } images->os.load = load_address; cmd_line_dest = base_ptr + COMMAND_LINE_OFFSET; images->ep = (ulong)base_ptr;