From c7e49ddc613534f2eb4286ae100fbc90938f160f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 4 Jun 2020 19:28:22 +0200 Subject: sandbox: handling out of memory assert() only works in debug mode. So checking a successful memory allocation should not use assert(). Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/sandbox/cpu/state.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/sandbox/cpu') diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 1f794123b3..34b6fff7e7 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -378,7 +378,10 @@ int state_init(void) state->ram_size = CONFIG_SYS_SDRAM_SIZE; state->ram_buf = os_malloc(state->ram_size); - assert(state->ram_buf); + if (!state->ram_buf) { + printf("Out of memory\n"); + os_exit(1); + } state_reset_for_test(state); /* -- cgit From df29730410ae2b1a861dcd094c14ea1a12892109 Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Thu, 25 Jun 2020 01:10:12 -0300 Subject: sandbox: Move section u_boot_list to make it RW In order to be able to update data in u_boot_list, move this section to make it RW. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass --- arch/sandbox/cpu/u-boot-spl.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sandbox/cpu') diff --git a/arch/sandbox/cpu/u-boot-spl.lds b/arch/sandbox/cpu/u-boot-spl.lds index de65b01b33..c60eb109b1 100644 --- a/arch/sandbox/cpu/u-boot-spl.lds +++ b/arch/sandbox/cpu/u-boot-spl.lds @@ -20,4 +20,4 @@ SECTIONS __bss_start = .; } -INSERT BEFORE .data; +INSERT AFTER .data; -- cgit