
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> --- 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 5b44e7ea4b7..7338db398d1 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -2177,6 +2177,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) || @@ -2362,15 +2371,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