changeset 278:ca343ccbca81

dar_reset_system(): check the entity_dar_callback pointer for NULL before calling through it
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 07 Aug 2017 04:20:45 +0000
parents 045541ab3ef5
children 1badec9097de
files src/cs/services/dar/dar_api.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/services/dar/dar_api.c	Sun Aug 06 22:22:06 2017 +0000
+++ b/src/cs/services/dar/dar_api.c	Mon Aug 07 04:20:45 2017 +0000
@@ -458,7 +458,8 @@
       dar_current_status = DAR_NORMAL_SCUTTLING;
 
       /* Call the MMI callback function to save some parameters before reset */
-      dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE);
+      if (dar_gbl_var_p->entity_dar_callback != NULL)
+        dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE);
 
       /* Send a trace before the reset of the system */
       DAR_SEND_TRACE("Voluntary reset of the system",RV_TRACE_LEVEL_DEBUG_HIGH);