refactor: check return values

Add CHECK statements on return values during mmu initialization. it is
possible that memory allocation fails if the heap is too small, which
will only be caught via indirect faults.
This patch also fixes the function definition for the fake
arch_mm_stack_init that returned void, but should return a bool, and
changes the fake layout so that start address in the layout is not 0,
which is the same as NULL and causes test failures.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I6ef0b6e31f9b5bfd683b18d43c21019970685dd9
diff --git a/src/mm.c b/src/mm.c
index 8180be9..b7e748d 100644
--- a/src/mm.c
+++ b/src/mm.c
@@ -1130,17 +1130,18 @@
 	plat_console_mm_init(stage1_locked, ppool);
 
 	/* Map each section. */
-	mm_identity_map(stage1_locked, layout_text_begin(), layout_text_end(),
-			MM_MODE_X, ppool);
+	CHECK(mm_identity_map(stage1_locked, layout_text_begin(),
+			      layout_text_end(), MM_MODE_X, ppool) != NULL);
 
-	mm_identity_map(stage1_locked, layout_rodata_begin(),
-			layout_rodata_end(), MM_MODE_R, ppool);
+	CHECK(mm_identity_map(stage1_locked, layout_rodata_begin(),
+			      layout_rodata_end(), MM_MODE_R, ppool) != NULL);
 
-	mm_identity_map(stage1_locked, layout_data_begin(), layout_data_end(),
-			MM_MODE_R | MM_MODE_W, ppool);
+	CHECK(mm_identity_map(stage1_locked, layout_data_begin(),
+			      layout_data_end(), MM_MODE_R | MM_MODE_W,
+			      ppool) != NULL);
 
 	/* Arch-specific stack mapping. */
-	arch_stack_mm_init(stage1_locked, ppool);
+	CHECK(arch_stack_mm_init(stage1_locked, ppool));
 
 	return true;
 }