[U-Boot] [PATCH 13/29] Correct malloc_limit value for pre-relocation malloc()

Simon Glass sjg at chromium.org
Sat Feb 28 06:06:37 CET 2015


The limit is measured from the start of the malloc() area and is not an
absolute address. Correct this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
This bug has been there for a while but was not causing problems. I have
been meaning to send a patch for a while.

 common/spl/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index cd75bbc..c655332 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -146,7 +146,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 			CONFIG_SYS_SPL_MALLOC_SIZE);
 	gd->flags |= GD_FLG_FULL_MALLOC_INIT;
 #elif defined(CONFIG_SYS_MALLOC_F_LEN)
-	gd->malloc_limit = gd->malloc_base + CONFIG_SYS_MALLOC_F_LEN;
+	gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
 	gd->malloc_ptr = 0;
 #endif
 #ifdef CONFIG_SPL_DM
-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list