summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2020-03-12 13:00:58 +0100
committerMark Brown <broonie@kernel.org>2020-03-12 13:12:35 +0000
commit16dcefc23eefda57ee705dcffba67f1bd42c01bc (patch)
treee5d16f3397e1be75a93a461a69ec0f1a1c0c3cda /sound/soc/sof
parenta5107b1a0993ff035dc8a1cf331da7bf961e4cbb (diff)
downloadlinux-stable-16dcefc23eefda57ee705dcffba67f1bd42c01bc.tar.gz
linux-stable-16dcefc23eefda57ee705dcffba67f1bd42c01bc.tar.bz2
linux-stable-16dcefc23eefda57ee705dcffba67f1bd42c01bc.zip
ASoC: SOF: Intel: Fix stream cleanup on hw free
Field "substream" gets assigned during stream setup in hda_dsp_pcm_hw_params() but it is never cleared afterwards during cleanup procedure. Now, any non-pcm operation e.g.: compress can mistakenly make use of that pointer as it's bypassing all "if (s->substream)" checks. Nulling the pointer during hw_free operation ensures no wild pointers are left behind. Fixes: cdae3b9a47aa ("ASoC: SOF: Intel: Add Intel specific HDA PCM operations") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200312120058.15057-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/intel/hda-stream.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c
index c0ab9bb2a797..d2234f802788 100644
--- a/sound/soc/sof/intel/hda-stream.c
+++ b/sound/soc/sof/intel/hda-stream.c
@@ -547,6 +547,8 @@ int hda_dsp_stream_hw_free(struct snd_sof_dev *sdev,
SOF_HDA_REG_PP_PPCTL, mask, 0);
spin_unlock_irq(&bus->reg_lock);
+ stream->substream = NULL;
+
return 0;
}