event: Verify log_facility is not NULL before using it.

Change-Id: Ia20d8764c2c91c200d06b7017ed06060e40cc2ed
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
This commit is contained in:
Cunyin Chang 2017-03-23 13:47:36 +08:00
parent fea78497a1
commit b6671531ad

View File

@ -113,12 +113,17 @@ spdk_app_get_shm_id(void)
static void static void
spdk_app_config_dump_global_section(FILE *fp) spdk_app_config_dump_global_section(FILE *fp)
{ {
const char *log_facility;
if (NULL == fp) if (NULL == fp)
return; return;
log_facility = spdk_get_log_facility();
assert(log_facility != NULL);
fprintf(fp, GLOBAL_CONFIG_TMPL, fprintf(fp, GLOBAL_CONFIG_TMPL,
spdk_app_get_core_mask(), spdk_trace_get_tpoint_group_mask(), spdk_app_get_core_mask(), spdk_trace_get_tpoint_group_mask(),
spdk_get_log_facility()); log_facility);
} }
int int