summaryrefslogtreecommitdiff
path: root/kernel/bump.c
diff options
context:
space:
mode:
authorNathan Lee <me@nwlee.tech>2026-07-26 16:11:47 -0500
committerNathan Lee <me@nwlee.tech>2026-07-26 16:11:47 -0500
commite98a69fd70533aa9f9b2bd1367e1ec158579d4c0 (patch)
tree665f790bd4a10f4b4284932341ad4a946b240c41 /kernel/bump.c
parent5c12f756189373fb25220fe8824d4df785e61742 (diff)
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.
Diffstat (limited to 'kernel/bump.c')
-rw-r--r--kernel/bump.c9
1 files 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 <bump.h>
#include <common.h>
+#include <log.h>
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) {