Skip to content

Commit 26552b5

Browse files
committed
Addressed copilot's comments
1 parent 3118f7a commit 26552b5

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

src/libwolfboot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,7 @@ int wolfBoot_dualboot_candidate(void)
14011401

14021402
if (fallback_v < candidate_v) {
14031403
wolfBoot_printf("Rollback to lower version not allowed\n");
1404+
wolfBoot_erase_partition(candidate);
14041405
return -1;
14051406
}
14061407
#endif

src/update_flash_hwswap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void RAMFUNCTION wolfBoot_start(void)
6262
if ((max_v > 0U) && (active_v < max_v)) {
6363
wolfBoot_printf("Rollback to lower version not allowed\n");
6464
boot_panic();
65+
continue;
6566
}
6667
#endif
6768
if ((wolfBoot_open_image(&fw_image, active) < 0)

tools/unit-tests/unit-update-ram-nofixed.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ START_TEST(test_invalid_update_rollback_to_older_boot_is_denied)
210210

211211
ck_assert_int_eq(wolfBoot_staged_ok, 0);
212212
ck_assert_int_eq(wolfBoot_panicked, 1);
213+
ck_assert_ptr_eq((void *)wolfBoot_stage_address, (void *)0xFFFFFFFF);
213214
cleanup_flash();
214215
}
215216
END_TEST

tools/unit-tests/unit-update-ram.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ START_TEST (test_invalid_update_type) {
380380
wolfBoot_start();
381381
ck_assert(!wolfBoot_staged_ok);
382382
ck_assert_int_eq(wolfBoot_panicked, 1);
383+
ck_assert_int_eq(get_version_ramloaded(), 2);
383384
cleanup_flash();
384385
}
385386

0 commit comments

Comments
 (0)