]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: ipc: Add null pointer check for substream->runtime
authorAjit Kumar Pandey <AjitKumar.Pandey@amd.com>
Thu, 16 Dec 2021 23:24:21 +0000 (17:24 -0600)
committerMark Brown <broonie@kernel.org>
Fri, 17 Dec 2021 11:06:18 +0000 (11:06 +0000)
commit9640d51e7785fbddc1523c18e38e713c04e42a6a
tree5396defd8d855508947113b79c4c925240ccd684
parent8a3029b30e2617b6a29f5b68f86a65ea7abf2017
ASoC: SOF: ipc: Add null pointer check for substream->runtime

When pcm stream is stopped "substream->runtime" pointer will be set
to NULL by ALSA core. In case host received an ipc msg from firmware
of type IPC_STREAM_POSITION after pcm stream is stopped, there will
be kernel NULL pointer exception in ipc_period_elapsed(). This patch
fixes it by adding NULL pointer check for "substream->runtime".

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211216232422.345164-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc.c