diff options
author | Hannes Schmelzer | 2018-10-11 07:44:42 +0200 |
---|---|---|
committer | Bin Meng | 2018-10-22 17:51:45 +0800 |
commit | c74e3295ae4a5338f91e971aee1638fa08a9b97d (patch) | |
tree | d57d8b1f9fe75028e21d0d8e18d8b19e7a5a82b7 /arch | |
parent | 97d20f69f53e7586394e48805f25f23d9a3ebaa8 (diff) |
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')
-rw-r--r-- | arch/x86/lib/bootm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 54c22fe6de3..832b1f901c6 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; |