Skip to content

Commit efa3039

Browse files
committed
boot: bootutil: swap_move: Fix maximum application size
Fixes this function as it was not updated after an earlier fix Signed-off-by: Jamie McCrae <[email protected]>
1 parent 20f98e0 commit efa3039

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

boot/bootutil/src/swap_move.c

+1-9
Original file line numberDiff line numberDiff line change
@@ -591,18 +591,10 @@ swap_run(struct boot_loader_state *state, struct boot_status *bs,
591591
int app_max_size(struct boot_loader_state *state)
592592
{
593593
uint32_t sector_sz_primary;
594-
uint32_t sector_sz_secondary;
595-
uint32_t sz_primary;
596-
uint32_t sz_secondary;
597594

598595
sector_sz_primary = boot_img_sector_size(state, BOOT_PRIMARY_SLOT, 0);
599-
sector_sz_secondary = boot_img_sector_size(state, BOOT_SECONDARY_SLOT, 0);
600596

601-
/* Account for image flags and move sector */
602-
sz_primary = app_max_sectors(state) * sector_sz_primary - sector_sz_primary;
603-
sz_secondary = app_max_sectors(state) * sector_sz_secondary;
604-
605-
return (sz_primary <= sz_secondary ? sz_primary : sz_secondary);
597+
return app_max_sectors(state) * sector_sz_primary;
606598
}
607599

608600
#endif

0 commit comments

Comments
 (0)