audio: Don't register audio device if name isn't given in audio_comp_initialize

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-04-10 03:19:03 +08:00 committed by Alan Carvalho de Assis
parent f3d20abe07
commit 1a6ee1b908

View file

@ -969,10 +969,13 @@ FAR struct audio_lowerhalf_s *audio_comp_initialize(FAR const char *name,
}
va_end(ap);
ret = audio_register(name, &priv->export);
if (ret < 0)
if (name != NULL)
{
goto free_lower;
ret = audio_register(name, &priv->export);
if (ret < 0)
{
goto free_lower;
}
}
return &priv->export;