binfmt/libelf/libelf_addrenv : Fix wrong loop index
kregionx_heap_idx array is based on CONFIG_KMM_REGIONS.
So for traversing whole kmm regions, it should use CONFIG_KMM_REGIONS instead of CONFIG_KMM_NHEAPS.
@@ -92,7 +92,7 @@ static int allocateregions(FAR struct elf_loadinfo_s *loadinfo)
uintptr_t *allocs[MPU_NUM_REGIONS] = {&loadinfo->textalloc, &loadinfo->roalloc, &loadinfo->dataalloc};
int count = 0;
int i;
- for (i = 0; i < CONFIG_KMM_NHEAPS; i++) {
+ for (i = 0; i < CONFIG_KMM_REGIONS; i++) {
if (kregionx_heap_idx[i] == CONFIG_HEAP_INDEX_LOADED_APP) {
count++;
}
