Skip to content

Commit 9f73145

Browse files
ofirsheOfir Shemesh
authored andcommitted
boot: bootutil: avoid full erase on BOOT_MAGIC_BAD in boot_set_next
Previously, boot_set_next() would perform a full slot erase when BOOT_MAGIC_BAD was detected. This is no longer done, as the decision on how to handle a corrupted image should be left to user code. Signed-off-by: Ofir Shemesh <[email protected]>
1 parent e8b2236 commit 9f73145

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

boot/bootutil/src/bootutil_public.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,7 @@ boot_set_next(const struct flash_area *fa, bool active, bool confirm)
573573
if (active) {
574574
rc = BOOT_EBADVECT;
575575
} else {
576-
/* The image slot is corrupt. There is no way to recover, so erase the
577-
* slot to allow future upgrades.
578-
*/
579-
flash_area_erase(fa, 0, flash_area_get_size(fa));
576+
/* This image will not be boot next time anyway */
580577
rc = BOOT_EBADIMAGE;
581578
}
582579
break;

0 commit comments

Comments
 (0)