From d1424263924904ab6ccb77509756dbdbffa4b86b Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 7 Apr 2025 17:41:38 +0200 Subject: [PATCH] Fixed 'backup disabled' case without ELF_SCATTERED --- src/update_flash.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/update_flash.c b/src/update_flash.c index 24b36e69..2cdc37fb 100644 --- a/src/update_flash.c +++ b/src/update_flash.c @@ -814,11 +814,14 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed) * wolfBoot_start*/ wolfBoot_swap_and_final_erase(0); -#else /* DISABLE_BACKUP */ /* Compute and verify scattered hash */ - if (wolfBoot_verify_scattered_hash(&boot) != 0) { - wolfBoot_printf("Scattered hash verification failed\n"); - return -1; - } +#else /* DISABLE_BACKUP */ + #ifdef ELF_SCATTERED + /* Compute and verify scattered hash */ + if (wolfBoot_verify_scattered_hash(&boot) != 0) { + wolfBoot_printf("Scattered hash verification failed\n"); + return -1; + } + #endif /* Direct Swap without power fail safety */ hal_flash_unlock();