]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Correct malloc_limit value for pre-relocation malloc()
authorSimon Glass <sjg@chromium.org>
Sat, 28 Feb 2015 05:06:37 +0000 (22:06 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 23 Apr 2015 15:05:53 +0000 (09:05 -0600)
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>
common/spl/spl.c

index 8e1fb40c47f12990c58bb36ab13e7e1596a80fb9..af1336ce100014b2da4a153a5413c491dad68b96 100644 (file)
@@ -158,7 +158,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