Skip to content

Commit

Permalink
Fix #1338, check status of call to CFE_ES_CDS_CachePreload
Browse files Browse the repository at this point in the history
Confirm that the call returned CFE_SUCCESS before continuing.
  • Loading branch information
jphickey committed Apr 16, 2021
1 parent e80aae9 commit 624d586
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/es/fsw/src/cfe_es_cds.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,11 @@ int32 CFE_ES_ClearCDS(void)
/* Clear the CDS to ensure everything is gone */
/* Create a block of zeros to write to the CDS */
Status = CFE_ES_CDS_CachePreload(&CDS->Cache, NULL, 0, sizeof(CDS->Cache.Data.Zero));
if (Status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("%s():CFE_ES_CDS_CachePreload failed, Status=0x%08X\n", __func__, (unsigned int)Status);
return Status;
}

/* While there is space to write another block of zeros, then do so */
while (CDS->Cache.Offset < CDS->TotalSize)
Expand Down

0 comments on commit 624d586

Please sign in to comment.