[U-Boot] [PATCH 4/5] board_init.c: fix simple malloc by storing malloc_limit

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Sun Aug 5 19:34:59 UTC 2018


board_init_f_init_reserve() sets gd->malloc_base but does
not set gd->malloc_limit. This results in malloc_simple()
failing, so let's set this here.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
---

 common/init/board_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/init/board_init.c b/common/init/board_init.c
index 526fee35ff..a9b21a7111 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -123,6 +123,7 @@ void board_init_f_init_reserve(ulong base)
 #if CONFIG_VAL(SYS_MALLOC_F_LEN)
 	/* go down one 'early malloc arena' */
 	gd->malloc_base = base;
+	gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
 	/* next alloc will be higher by one 'early malloc arena' size */
 	base += CONFIG_VAL(SYS_MALLOC_F_LEN);
 #endif
-- 
2.17.1



More information about the U-Boot mailing list