diff options
| author | Alexandru Gagniuc <mr.nuke.me@gmail.com> | 2021-03-29 12:05:10 -0500 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2021-04-14 15:23:01 -0400 |
| commit | f0a6ec3656e5561a3d2e246b0fad7e55e419515b (patch) | |
| tree | 519fa557ce4152fdfd9a8322020e508d32d6b636 /include/linux/linux_string.h | |
| parent | 78015263b9789ef12fa6e454cf5041f97ce40da4 (diff) | |
| download | u-boot-f0a6ec3656e5561a3d2e246b0fad7e55e419515b.tar.gz u-boot-f0a6ec3656e5561a3d2e246b0fad7e55e419515b.tar.xz u-boot-f0a6ec3656e5561a3d2e246b0fad7e55e419515b.zip | |
spl: fit: Don't overwrite previous loadable if "load" is missing
spl_load_fit_image() will try to load an image at the address given
in the "load" property. Absent such property, it uses
image_info->load_addr
Correct use of this is demonstrated in spl_fit_append_fdt(), which
resets the 'load_addr' before each spl_load_fit_image() call.
On the other hand loading "loadables" loop in spl_load_simple_fit()
completely ignores this. It re-uses the same structure, but doesn't
reset load_addr. If loadable [i] does not have a "load" property, its
load address defaults to load_addr, which still contains the address
of loadable [i - 1].
A simple solution is to treat NULL as an invalid load address. The
caller can set load_addr = 0 to request an abort if the "load"
property is absent.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/linux/linux_string.h')
0 files changed, 0 insertions, 0 deletions
