Skip to content

Commit 9065693

Browse files
kv2019ibroonie
authored andcommitted
ASoC: SOF: Intel: hda: fix null deref on system suspend entry
When system enters suspend with an active stream, SOF core calls hw_params_upon_resume(). On Intel platforms with HDA DMA used to manage the link DMA, this leads to call chain of hda_dsp_set_hw_params_upon_resume() -> hda_dsp_dais_suspend() -> hda_dai_suspend() -> hda_ipc4_post_trigger() A bug is hit in hda_dai_suspend() as hda_link_dma_cleanup() is run first, which clears hext_stream->link_substream, and then hda_ipc4_post_trigger() is called with a NULL snd_pcm_substream pointer. Fixes: 2b009fa ("ASoC: SOF: Intel: hda: Unify DAI drv ops for IPC3 and IPC4") Link: thesofproject#5080 Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2163aff commit 9065693

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sound/soc/sof/intel/hda-dai.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,12 +617,6 @@ static int hda_dai_suspend(struct hdac_bus *bus)
617617
sdai = swidget->private;
618618
ops = sdai->platform_private;
619619

620-
ret = hda_link_dma_cleanup(hext_stream->link_substream,
621-
hext_stream,
622-
cpu_dai);
623-
if (ret < 0)
624-
return ret;
625-
626620
/* for consistency with TRIGGER_SUSPEND */
627621
if (ops->post_trigger) {
628622
ret = ops->post_trigger(sdev, cpu_dai,
@@ -631,6 +625,12 @@ static int hda_dai_suspend(struct hdac_bus *bus)
631625
if (ret < 0)
632626
return ret;
633627
}
628+
629+
ret = hda_link_dma_cleanup(hext_stream->link_substream,
630+
hext_stream,
631+
cpu_dai);
632+
if (ret < 0)
633+
return ret;
634634
}
635635
}
636636

0 commit comments

Comments
 (0)