|
@@ -204,16 +204,12 @@ static int acpi_ghes_record_mem_error(uint64_t error_block_address,
|
|
|
|
|
|
/* This is the length if adding a new generic error data entry*/
|
|
/* This is the length if adding a new generic error data entry*/
|
|
data_length = ACPI_GHES_DATA_LENGTH + ACPI_GHES_MEM_CPER_LENGTH;
|
|
data_length = ACPI_GHES_DATA_LENGTH + ACPI_GHES_MEM_CPER_LENGTH;
|
|
-
|
|
|
|
/*
|
|
/*
|
|
- * Check whether it will run out of the preallocated memory if adding a new
|
|
|
|
- * generic error data entry
|
|
|
|
|
|
+ * It should not run out of the preallocated memory if adding a new generic
|
|
|
|
+ * error data entry
|
|
*/
|
|
*/
|
|
- if ((data_length + ACPI_GHES_GESB_SIZE) > ACPI_GHES_MAX_RAW_DATA_LENGTH) {
|
|
|
|
- error_report("Not enough memory to record new CPER!!!");
|
|
|
|
- g_array_free(block, true);
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
|
|
+ assert((data_length + ACPI_GHES_GESB_SIZE) <=
|
|
|
|
+ ACPI_GHES_MAX_RAW_DATA_LENGTH);
|
|
|
|
|
|
/* Build the new generic error status block header */
|
|
/* Build the new generic error status block header */
|
|
acpi_ghes_generic_error_status(block, ACPI_GEBS_UNCORRECTABLE,
|
|
acpi_ghes_generic_error_status(block, ACPI_GEBS_UNCORRECTABLE,
|