diff mbox

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

Message ID 1425100013-4796-14-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Feb. 28, 2015, 5:06 a.m. UTC
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@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 mbox

Patch

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