logger: Fix log_err usage at early stages of sof-logger run

This function could fail when called before convert()

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
Karol Trzcinski 2020-10-19 17:32:48 +02:00 committed by Liam Girdwood
parent 2de506025f
commit 1ad0269f5d
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ extern struct convert_config *global_config;
void log_err(const char *fmt, ...)
{
FILE *out_fd = global_config->out_fd;
FILE *out_fd = global_config ? global_config->out_fd : NULL;
static const char prefix[] = "error: ";
ssize_t needed_size;
va_list args, args_alloc;