mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
bootm: fix size arg of flush_cache() in bootm_load_os().
Variable _load_end_ points to end address of uncompressed buffer
(*not* uncomress_buffer_end / sizeof(ulong)), so multipling uncompressed
size with sizeof(ulong) is grossly incorrect in flush_cache().
It might lead to access of address beyond valid memory range and hang the CPU.
Tested on MIPS architecture by using compressed(gzip, lzma)
and uncompressed uImage.
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: POOVENDHAN SELVARAJ <quic_poovendh@quicinc.com>
Change-Id: Ia93bfc549e348e655a748a24f59b38a0f80659ce
(cherry picked from commit 8d4f11c203)
This commit is contained in:
parent
60f90b3b77
commit
77d37303b4
1 changed files with 1 additions and 1 deletions
|
|
@ -442,7 +442,7 @@ int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
|
|||
bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
||||
return err;
|
||||
}
|
||||
flush_cache(load, (*load_end - load) * sizeof(ulong));
|
||||
flush_cache(load, *load_end - load);
|
||||
|
||||
debug(" %s loaded at 0x%08lx, end = 0x%08lx\n",
|
||||
genimg_get_type_name(os.type), load, *load_end);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue