ASoC: SOF: Intel: Fix stream cleanup on hw free
authorCezary Rojewski <cezary.rojewski@intel.com>
Thu, 12 Mar 2020 12:00:58 +0000 (13:00 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 12 Mar 2020 13:12:35 +0000 (13:12 +0000)
commit16dcefc23eefda57ee705dcffba67f1bd42c01bc
treee5d16f3397e1be75a93a461a69ec0f1a1c0c3cda
parenta5107b1a0993ff035dc8a1cf331da7bf961e4cbb
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>
sound/soc/sof/intel/hda-stream.c