diff --git a/sound/soc/sof/ipc4-compress.c b/sound/soc/sof/ipc4-compress.c index 05cebb780032e7..839287796742bd 100644 --- a/sound/soc/sof/ipc4-compress.c +++ b/sound/soc/sof/ipc4-compress.c @@ -107,6 +107,9 @@ static int sof_ipc4_compr_stream_free(struct snd_sof_dev *sdev, int ret = 0; int err = 0; + if (!pcm_ops) + return -EINVAL; + if (spcm->prepared[dir]) { if (spcm->pending_stop[dir]) pcm_ops->trigger(sdev->component, NULL, spcm, @@ -542,6 +545,9 @@ static int sof_ipc4_compr_trigger(struct snd_soc_component *component, bool trigger_platform = false; int ret = 0; + if (!pcm_ops || !pcm_ops->trigger) + return -EINVAL; + spcm = snd_sof_find_spcm_dai(component, rtd); if (!spcm) { dev_err(sdev->dev, "%s: can't find spcm\n", __func__);