summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/intel/cougar_canyon2/romstage.c4
-rw-r--r--src/soc/intel/fsp_baytrail/romstage/romstage.c4
-rw-r--r--src/soc/intel/fsp_broadwell_de/romstage/romstage.c8
-rw-r--r--src/southbridge/intel/fsp_i89xx/romstage.c4
-rw-r--r--src/southbridge/intel/fsp_rangeley/romstage.c4
5 files changed, 15 insertions, 9 deletions
diff --git a/src/mainboard/intel/cougar_canyon2/romstage.c b/src/mainboard/intel/cougar_canyon2/romstage.c
index 998528dc4f..bf5b738754 100644
--- a/src/mainboard/intel/cougar_canyon2/romstage.c
+++ b/src/mainboard/intel/cougar_canyon2/romstage.c
@@ -298,7 +298,9 @@ void romstage_main_continue(EFI_STATUS status, VOID *HobListPtr) {
}
/* Save the HOB pointer in CBMEM to be used in ramstage. */
- cbmem_hob_ptr = cbmem_add (CBMEM_ID_HOB_POINTER, sizeof(*HobListPtr));
+ cbmem_hob_ptr = cbmem_add(CBMEM_ID_HOB_POINTER, sizeof(*HobListPtr));
+ if (cbmem_hob_ptr == NULL)
+ die("Could not allocate cbmem for HOB pointer");
*(u32*)cbmem_hob_ptr = (u32)HobListPtr;
post_code(0x4f);
diff --git a/src/soc/intel/fsp_baytrail/romstage/romstage.c b/src/soc/intel/fsp_baytrail/romstage/romstage.c
index 9d204d16e2..f8d985eaea 100644
--- a/src/soc/intel/fsp_baytrail/romstage/romstage.c
+++ b/src/soc/intel/fsp_baytrail/romstage/romstage.c
@@ -252,7 +252,9 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr)
cbmem_was_initted = !cbmem_recovery(prev_sleep_state == ACPI_S3);
/* Save the HOB pointer in CBMEM to be used in ramstage*/
- cbmem_hob_ptr = cbmem_add (CBMEM_ID_HOB_POINTER, sizeof(*hob_list_ptr));
+ cbmem_hob_ptr = cbmem_add(CBMEM_ID_HOB_POINTER, sizeof(*hob_list_ptr));
+ if (cbmem_hob_ptr == NULL)
+ die("Could not allocate cbmem for HOB pointer");
*(u32*)cbmem_hob_ptr = (u32)hob_list_ptr;
post_code(0x4e);
diff --git a/src/soc/intel/fsp_broadwell_de/romstage/romstage.c b/src/soc/intel/fsp_broadwell_de/romstage/romstage.c
index 49d9a94919..5754ec00a5 100644
--- a/src/soc/intel/fsp_broadwell_de/romstage/romstage.c
+++ b/src/soc/intel/fsp_broadwell_de/romstage/romstage.c
@@ -106,11 +106,9 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr)
cbmem_was_initted = !cbmem_recovery(0);
/* Save the HOB pointer in CBMEM to be used in ramstage*/
- cbmem_hob_ptr = cbmem_add (CBMEM_ID_HOB_POINTER, sizeof(*hob_list_ptr));
- if (cbmem_hob_ptr == NULL) {
- printk(BIOS_DEBUG, "Failed to save HOB pointer in CBMEM.\n");
- return;
- }
+ cbmem_hob_ptr = cbmem_add(CBMEM_ID_HOB_POINTER, sizeof(*hob_list_ptr));
+ if (cbmem_hob_ptr == NULL)
+ die("Could not allocate cbmem for HOB pointer");
*(u32 *)cbmem_hob_ptr = (u32)hob_list_ptr;
/* Load the ramstage. */
diff --git a/src/southbridge/intel/fsp_i89xx/romstage.c b/src/southbridge/intel/fsp_i89xx/romstage.c
index 09cce59444..c2b5221c48 100644
--- a/src/southbridge/intel/fsp_i89xx/romstage.c
+++ b/src/southbridge/intel/fsp_i89xx/romstage.c
@@ -208,7 +208,9 @@ void romstage_main_continue(EFI_STATUS status, VOID *HobListPtr) {
}
/* Save the HOB pointer in CBMEM to be used in ramstage. */
- cbmem_hob_ptr = cbmem_add (CBMEM_ID_HOB_POINTER, sizeof(HobListPtr));
+ cbmem_hob_ptr = cbmem_add(CBMEM_ID_HOB_POINTER, sizeof(HobListPtr));
+ if (cbmem_hob_ptr == NULL)
+ die("Could not allocate cbmem for HOB pointer");
*(uint32_t*)cbmem_hob_ptr = (uint32_t)HobListPtr;
post_code(0x4f);
diff --git a/src/southbridge/intel/fsp_rangeley/romstage.c b/src/southbridge/intel/fsp_rangeley/romstage.c
index 042aaf93dd..74df69112c 100644
--- a/src/southbridge/intel/fsp_rangeley/romstage.c
+++ b/src/southbridge/intel/fsp_rangeley/romstage.c
@@ -122,7 +122,9 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr) {
cbmem_was_initted = !cbmem_recovery(0);
/* Save the HOB pointer in CBMEM to be used in ramstage*/
- cbmem_hob_ptr = cbmem_add (CBMEM_ID_HOB_POINTER, sizeof(*hob_list_ptr));
+ cbmem_hob_ptr = cbmem_add(CBMEM_ID_HOB_POINTER, sizeof(*hob_list_ptr));
+ if (cbmem_hob_ptr == NULL)
+ die("Could not allocate cbmem for HOB pointer");
*(u32*)cbmem_hob_ptr = (u32)hob_list_ptr;
post_code(0x4e);