sim/alsa: add ptr check in _stop

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
This commit is contained in:
qiaohaijiao1 2024-02-02 18:29:36 +08:00 committed by Xiang Xiao
parent 09afb4d7d0
commit eba292f4b9
1 changed files with 10 additions and 4 deletions

View File

@ -560,11 +560,17 @@ static int sim_audio_stop(struct audio_lowerhalf_s *dev)
priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_COMPLETE, NULL, OK);
#endif
apb_free(priv->aux);
priv->aux = NULL;
if (priv->aux)
{
apb_free(priv->aux);
priv->aux = NULL;
}
priv->ops->uninit(priv->codec);
priv->ops = NULL;
if (priv->ops)
{
priv->ops->uninit(priv->codec);
priv->ops = NULL;
}
return 0;
}