mirror of
https://github.com/apache/nuttx.git
synced 2026-03-24 07:35:07 +08:00
sim/alsa: add ptr check in _stop
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user