ASoC: SOF: ipc4-pcm: fix possible null pointer deference
authorChao Song <chao.song@linux.intel.com>
Wed, 16 Aug 2023 13:33:11 +0000 (16:33 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 16 Aug 2023 13:47:01 +0000 (14:47 +0100)
commit2d218b45848b92b03b220bf4d9bef29f058f866f
tree1e3d6e87c3d6e18f5c8fe5bd83096d4145e82da2
parent0fc7769e54e747c8fd1b4899af2ac43cb68daa1c
ASoC: SOF: ipc4-pcm: fix possible null pointer deference

The call to snd_sof_find_spcm_dai() could return NULL,
add nullable check for the return value to avoid null
pointer defenrece.

Fixes: 7cb19007baba ("ASoC: SOF: ipc4-pcm: add hw_params")
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230816133311.7523-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-pcm.c