Skip to content

Commit f19081b

Browse files
nordicjmbjarki-andreasen
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]>
1 parent bdc6c9d commit f19081b

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
@@ -1375,7 +1375,7 @@ boot_validated_swap_type(struct boot_loader_state *state,
13751375

13761376
#ifdef PM_S1_ADDRESS
13771377
#ifdef PM_CPUNET_B0N_ADDRESS
1378-
if(reset_addr < PM_CPUNET_B0N_ADDRESS)
1378+
if(!(reset_addr >= PM_CPUNET_APP_ADDRESS && reset_addr < PM_CPUNET_APP_END_ADDRESS))
13791379
#endif
13801380
{
13811381
const struct flash_area *primary_fa;
@@ -1448,7 +1448,8 @@ boot_validated_swap_type(struct boot_loader_state *state,
14481448
* update and indicate to the caller of this function that no update is
14491449
* available
14501450
*/
1451-
if (upgrade_valid && reset_addr > PM_CPUNET_B0N_ADDRESS) {
1451+
if (upgrade_valid && reset_addr >= PM_CPUNET_APP_ADDRESS &&
1452+
reset_addr < PM_CPUNET_APP_END_ADDRESS) {
14521453
struct image_header *hdr = (struct image_header *)secondary_fa->fa_off;
14531454
uint32_t vtable_addr = (uint32_t)hdr + hdr->ih_hdr_size;
14541455
uint32_t *net_core_fw_addr = (uint32_t *)(vtable_addr);

0 commit comments

Comments
 (0)