Commit a1927f4d authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Fabio Utzig
Browse files

Fix setting confirm flag

It was impossible to set confirm flag due to incorrect comparison.
In this point of time state->image_ok is already decoded and contains
one of following values:

If BOOT_FLAG_UNSET then we are ok to set a confirm flag.

Signed-off-by: default avatarŁukasz Rymanowski <lukasz.rymanowski@codecoup.pl>
parent 1d96f36d
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/bootutil/src/bootutil_misc.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -574,7 +574,7 @@ boot_set_confirmed(void)
        goto done;
    }

    if (state_slot0.image_ok != erased_val) {
    if (state_slot0.image_ok != BOOT_FLAG_UNSET) {
        /* Already confirmed. */
        goto done;
    }