aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorHannes Schmelzer <hannes.schmelzer@br-automation.com>2018-10-11 07:44:42 +0200
committerBin Meng <bmeng.cn@gmail.com>2018-10-22 17:51:45 +0800
commitc74e3295ae4a5338f91e971aee1638fa08a9b97d (patch)
treed57d8b1f9fe75028e21d0d8e18d8b19e7a5a82b7 /arch/x86
parent97d20f69f53e7586394e48805f25f23d9a3ebaa8 (diff)
downloadu-boot-c74e3295ae4a5338f91e971aee1638fa08a9b97d.zip
u-boot-c74e3295ae4a5338f91e971aee1638fa08a9b97d.tar.gz
u-boot-c74e3295ae4a5338f91e971aee1638fa08a9b97d.tar.bz2
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 <hannes.schmelzer@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/lib/bootm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 54c22fe..832b1f9 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;