linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: mediatek: sof-common: Add NULL check for normal_link string
@ 2024-01-11 10:52 AngeloGioacchino Del Regno
  2024-01-11 21:28 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-01-11 10:52 UTC (permalink / raw)
  To: lgirdwood
  Cc: broonie, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	trevor.wu, kuninori.morimoto.gx, chunxu.li, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek

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>
---
 sound/soc/mediatek/common/mtk-dsp-sof-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
index f3894010f656..7ec8965a70c0 100644
--- a/sound/soc/mediatek/common/mtk-dsp-sof-common.c
+++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
@@ -24,7 +24,7 @@ int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
 		struct snd_soc_dai_link *sof_dai_link = NULL;
 		const struct sof_conn_stream *conn = &sof_priv->conn_streams[i];
 
-		if (strcmp(rtd->dai_link->name, conn->normal_link))
+		if (conn->normal_link && strcmp(rtd->dai_link->name, conn->normal_link))
 			continue;
 
 		for_each_card_rtds(card, runtime) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: mediatek: sof-common: Add NULL check for normal_link string
  2024-01-11 10:52 [PATCH] ASoC: mediatek: sof-common: Add NULL check for normal_link string AngeloGioacchino Del Regno
@ 2024-01-11 21:28 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-01-11 21:28 UTC (permalink / raw)
  To: lgirdwood, AngeloGioacchino Del Regno
  Cc: perex, tiwai, matthias.bgg, trevor.wu, kuninori.morimoto.gx,
	chunxu.li, linux-sound, linux-kernel, linux-arm-kernel,
	linux-mediatek

On Thu, 11 Jan 2024 11:52:26 +0100, AngeloGioacchino Del Regno wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: mediatek: sof-common: Add NULL check for normal_link string
      commit: e3b3ec967a7d93b9010a5af9a2394c8b5c8f31ed

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-11 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11 10:52 [PATCH] ASoC: mediatek: sof-common: Add NULL check for normal_link string AngeloGioacchino Del Regno
2024-01-11 21:28 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).