Commit 08fa2672 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Fix copy_done setting

This compliments the previous change on `image_ok` and also removes
`flash_area_erased_val` call that is not needed anymore.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent a1927f4d
Loading
Loading
Loading
Loading
+1 −3
Changes for boot/bootutil/src/bootutil_misc.c: 1 added line, 3 removed lines.
Original line number Diff line number Diff line
@@ -539,7 +539,6 @@ boot_set_confirmed(void)
{
    const struct flash_area *fap;
    struct boot_swap_state state_slot0;
    uint8_t erased_val;
    int rc;

    rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_0, &state_slot0);
@@ -567,8 +566,7 @@ boot_set_confirmed(void)
        goto done;
    }

    erased_val = flash_area_erased_val(fap);
    if (state_slot0.copy_done == erased_val) {
    if (state_slot0.copy_done == BOOT_FLAG_UNSET) {
        /* Swap never completed.  This is unexpected. */
        rc = BOOT_EBADVECT;
        goto done;