arch/arm: fix wrong conditionals on up_addregion
If mem_start and mem_size have no values, it means configs are
not set properly. And we don't need to run next loop.
@@ -216,8 +216,9 @@ void up_addregion(void)
char *mem_size = CONFIG_HEAPx_SIZE;
for (region_cnt = 0; region_cnt < CONFIG_MM_REGIONS - 1; region_cnt++) {
- if (*mem_start || *mem_size) {
- dbg("CONFIG_HEAPx_BASE and CONFIG_HEAPx_SIZE are not defined properly\n");
+ if (!*mem_start || !*mem_size) {
+ dbg("Fail to add %dth heap region\n", region_cnt + 1);
+ break;
}
kumm_addregion((void *)strtol(mem_start, &mem_start, 16), (size_t)strtol(mem_size, &mem_size, 0));
