diff options
| author | Nathan Lee <me@nwlee.tech> | 2026-07-26 16:11:47 -0500 |
|---|---|---|
| committer | Nathan Lee <me@nwlee.tech> | 2026-07-26 16:11:47 -0500 |
| commit | e98a69fd70533aa9f9b2bd1367e1ec158579d4c0 (patch) | |
| tree | 665f790bd4a10f4b4284932341ad4a946b240c41 | |
| parent | 5c12f756189373fb25220fe8824d4df785e61742 (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.
| -rw-r--r-- | kernel/bump.c | 9 |
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) { |
