diff options
author | Dario Binacchi | 2020-05-27 13:56:19 +0200 |
---|---|---|
committer | Tom Rini | 2020-07-08 17:21:46 -0400 |
commit | 585b468a8c73df0445e994443a39869697fc53a8 (patch) | |
tree | 5fdecc421ccbed92f5aaeda6cbaa58957c823f47 /common | |
parent | 146a17ad64e2132222d7134b6961b26817faa3bd (diff) |
spl: fit: fail fit loading in case of FDT appending error
If uboot does not embed its device tree and the FIT loading function
returns error in case of failure in the FDT append, the redundant itb
image could be loaded.
cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/spl/spl_fit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index f581a224213..365104fe028 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -619,9 +619,12 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, * Booting a next-stage U-Boot may require us to append the FDT. * We allow this to fail, as the U-Boot image might embed its FDT. */ - if (spl_image->os == IH_OS_U_BOOT) - spl_fit_append_fdt(spl_image, info, sector, fit, - images, base_offset); + if (spl_image->os == IH_OS_U_BOOT) { + ret = spl_fit_append_fdt(spl_image, info, sector, fit, + images, base_offset); + if (!IS_ENABLED(CONFIG_OF_EMBED) && ret < 0) + return ret; + } firmware_node = node; /* Now check if there are more images for us to load */ |