From e98a69fd70533aa9f9b2bd1367e1ec158579d4c0 Mon Sep 17 00:00:00 2001 From: Nathan Lee Date: Sun, 26 Jul 2026 16:11:47 -0500 Subject: fix: km_init fails to find memory This resolves an issue where km_init would fail to find the memory property if it was not the first node that it looked at. --- kernel/bump.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/bump.c b/kernel/bump.c index fd4f25d..8b7bd53 100644 --- a/kernel/bump.c +++ b/kernel/bump.c @@ -1,5 +1,6 @@ #include #include +#include static char eheap[EHEAP_SIZE] = {0}; static size_t eheap_off = 0; @@ -7,8 +8,12 @@ static size_t eheap_off = 0; struct mem_info *km_find_memory(struct dt_node *head) { struct dt_node *child = head->children; while (child) { - return km_find_memory(child); - child = child->next; + struct mem_info *location = km_find_memory(child); + if (location) { + return location; + } else { + child = child->next; + } } if (strlen(head->name) != 0) { -- cgit v1.2.3