Otherwise, os_type will be determined unconditionally for the FIT image
buffer. As the buffer has zero size, this leads to an os_type of
filetype_unknown. The ARM32 support has an "ARM raw image" that matches
against filetype_unknown leading eventually to a crash trying to execute
the FIT image's FDT header.

Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
---
 common/bootm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/bootm.c b/common/bootm.c
index 739be02fe571..a26ea82684a6 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -618,7 +618,7 @@ static int bootm_open_fit(struct image_data *data)
        int ret;
 
        if (!IS_ENABLED(CONFIG_FITIMAGE))
-               return 0;
+               return -ENOSYS;
 
        header = (struct fdt_header *)data->os_header;
        flen = bootm_get_os_size(data);
-- 
2.39.5


Reply via email to