]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: mediatek: sof-common: Add NULL check for normal_link string
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Thu, 11 Jan 2024 10:52:26 +0000 (11:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:45:26 +0000 (15:45 -0800)
commitcde6ca5872bf67744dffa875a7cb521ab007b7ef
tree4c2c5c25d0a72287fa158146da6f081a2d4af03d
parent40d9d2179ff96898f3b1534b214f6ae6f331483b
ASoC: mediatek: sof-common: Add NULL check for normal_link string

[ Upstream commit e3b3ec967a7d93b9010a5af9a2394c8b5c8f31ed ]

It's not granted that all entries of struct sof_conn_stream declare
a `normal_link` (a non-SOF, direct link) string, and this is the case
for SoCs that support only SOF paths (hence do not support both direct
and SOF usecases).

For example, in the case of MT8188 there is no normal_link string in
any of the sof_conn_stream entries and there will be more drivers
doing that in the future.

To avoid possible NULL pointer KPs, add a NULL check for `normal_link`.

Fixes: 0caf1120c583 ("ASoC: mediatek: mt8195: extract SOF common code")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://msgid.link/r/20240111105226.117603-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/mediatek/common/mtk-dsp-sof-common.c