From a1927f4d6bfe4c4d55717477543913ceb3d87412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Wed, 26 Sep 2018 15:31:50 +0200 Subject: [PATCH] Fix setting confirm flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Ɓukasz Rymanowski --- boot/bootutil/src/bootutil_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootutil/src/bootutil_misc.c b/boot/bootutil/src/bootutil_misc.c index 6d992b4b..9fcea4ed 100644 --- a/boot/bootutil/src/bootutil_misc.c +++ b/boot/bootutil/src/bootutil_misc.c @@ -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; }