Skip to content

Commit b3d65d9

Browse files
nordicjmrlubos
authored andcommitted
[nrf noup] bootutil: loader: Fix netcore address checking
Fixes an issues with wrongly checking the network core reset address Signed-off-by: Jamie McCrae <[email protected]> (cherry picked from commit fcf0a31)
1 parent 5f52f93 commit b3d65d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

boot/bootutil/src/loader.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ boot_validated_swap_type(struct boot_loader_state *state,
14071407

14081408
#ifdef PM_S1_ADDRESS
14091409
#ifdef PM_CPUNET_B0N_ADDRESS
1410-
if(reset_addr < PM_CPUNET_B0N_ADDRESS)
1410+
if(!(reset_addr >= PM_CPUNET_APP_ADDRESS && reset_addr < PM_CPUNET_APP_END_ADDRESS))
14111411
#endif
14121412
{
14131413
const struct flash_area *primary_fa;
@@ -1480,7 +1480,8 @@ boot_validated_swap_type(struct boot_loader_state *state,
14801480
* update and indicate to the caller of this function that no update is
14811481
* available
14821482
*/
1483-
if (upgrade_valid && reset_addr > PM_CPUNET_B0N_ADDRESS) {
1483+
if (upgrade_valid && reset_addr >= PM_CPUNET_APP_ADDRESS &&
1484+
reset_addr < PM_CPUNET_APP_END_ADDRESS) {
14841485
struct image_header *hdr = (struct image_header *)secondary_fa->fa_off;
14851486
uint32_t vtable_addr = (uint32_t)hdr + hdr->ih_hdr_size;
14861487
uint32_t *net_core_fw_addr = (uint32_t *)(vtable_addr);

0 commit comments

Comments
 (0)