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:
parent
f3d20abe07
commit
1a6ee1b908
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue