
From: Simon Glass <sjg@chromium.org> We may as well have all the checks together, so move the call to fit_image_check_target_arch() into check_allowed(). Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) boot/image-fit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index d4901d8e6d2..cd2052be0a4 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -2175,6 +2175,15 @@ static int check_allowed(const void *fit, int noffset, bool type_ok, os_ok; uint8_t os; + bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH); + if (!tools_build() && IS_ENABLED(CONFIG_SANDBOX)) { + if (!fit_image_check_target_arch(fit, noffset)) { + puts("Unsupported Architecture\n"); + bootstage_error(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH); + return -ENOEXEC; + } + } + bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL); type_ok = fit_image_check_type(fit, noffset, image_type) || fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE) || @@ -2360,15 +2369,6 @@ int fit_image_load(struct bootm_headers *images, ulong addr, if (noffset < 0) return noffset; - bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH); - if (!tools_build() && IS_ENABLED(CONFIG_SANDBOX)) { - if (!fit_image_check_target_arch(fit, noffset)) { - puts("Unsupported Architecture\n"); - bootstage_error(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH); - return -ENOEXEC; - } - } - ret = check_allowed(fit, noffset, image_type, arch, bootstage_id); if (ret) return ret; -- 2.43.0