From: Przemyslaw Marczak
Date: Fri, 28 Nov 2014 13:34:59 +0000 (+0100)
Subject: samsung: board: dram_init: return error if no mem
X-Git-Tag: accepted/tizen/common/20141210.130049~1
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=620473676d086060a5bc909bfc8256c5552c14ed;p=platform%2Fkernel%2Fu-boot.git
samsung: board: dram_init: return error if no mem
Change-Id: Ic1bcce5bc90a38b751f32bef23cae79e24d5a443
Signed-off-by: Przemyslaw Marczak
---
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 95c3eee..7b1d7d2 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);