summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2014-11-28 14:34:59 +0100
committerPrzemyslaw Marczak <p.marczak@samsung.com>2015-05-18 13:47:41 +0200
commit4856730ea9d4be77a1aea48ad4380c7a9eb05015 (patch)
treec9ff72635be90c492cc7326f9016a4a34e7d04be
parente433eba1104e734c473e1376fd13722814a6954c (diff)
downloadu-boot-4856730ea9d4be77a1aea48ad4380c7a9eb05015.tar.gz
u-boot-4856730ea9d4be77a1aea48ad4380c7a9eb05015.tar.bz2
u-boot-4856730ea9d4be77a1aea48ad4380c7a9eb05015.zip
samsung: board: dram_init: return error if no mem
Change-Id: Ic1bcce5bc90a38b751f32bef23cae79e24d5a443 Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
-rw-r--r--board/samsung/common/board.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index b9af3593d2..e359060870 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -103,6 +103,9 @@ int dram_init(void)
mem = malloc(sizeof(struct memory_info));
+ if (!mem)
+ return -ENOMEM;
+
mem->banks = fdtdec_decode_memory(gd->fdt_blob, &mem->addr[0],
&mem->size[0],
CONFIG_NR_DRAM_BANKS);