Linux Sound subsystem development
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Chen-Yu Tsai <wenst@chromium.org>, Mark Brown <broonie@kernel.org>
Cc: Trevor Wu <trevor.wu@mediatek.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2] ASoC: mediatek: mt8195: Add platform entry for ETDM1_OUT_BE dai link
Date: Mon, 24 Jun 2024 09:39:16 +0200	[thread overview]
Message-ID: <aefe76a3-5712-4e34-8990-0463a5036324@collabora.com> (raw)
In-Reply-To: <20240624061257.3115467-1-wenst@chromium.org>

Il 24/06/24 08:12, Chen-Yu Tsai ha scritto:
> Commit e70b8dd26711 ("ASoC: mediatek: mt8195: Remove afe-dai component
> and rework codec link") removed the codec entry for the ETDM1_OUT_BE
> dai link entirely instead of replacing it with COMP_EMPTY(). This worked
> by accident as the remaining COMP_EMPTY() platform entry became the codec
> entry, and the platform entry became completely empty, effectively the
> same as COMP_DUMMY() since snd_soc_fill_dummy_dai() doesn't do anything
> for platform entries.
> 
> This causes a KASAN out-of-bounds warning in mtk_soundcard_common_probe()
> in sound/soc/mediatek/common/mtk-soundcard-driver.c:
> 
> 	for_each_card_prelinks(card, i, dai_link) {
> 		if (adsp_node && !strncmp(dai_link->name, "AFE_SOF", strlen("AFE_SOF")))
> 			dai_link->platforms->of_node = adsp_node;
> 		else if (!dai_link->platforms->name && !dai_link->platforms->of_node)
> 			dai_link->platforms->of_node = platform_node;
> 	}
> 
> where the code expects the platforms array to have space for at least one entry.
> 
> Add an COMP_EMPTY() entry so that dai_link->platforms has space.
> 
> Fixes: e70b8dd26711 ("ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> 
> ---
> Changes since v1:
> - Reword commit message with more details on how the original commit
>    got things wrong, and what this commit adds and fixes
> ---
>   sound/soc/mediatek/mt8195/mt8195-mt6359.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
> index ca8751190520..2832ef78eaed 100644
> --- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c
> +++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
> @@ -827,6 +827,7 @@ SND_SOC_DAILINK_DEFS(ETDM2_IN_BE,
>   
>   SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE,
>   		     DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")),
> +		     DAILINK_COMP_ARRAY(COMP_EMPTY()),
>   		     DAILINK_COMP_ARRAY(COMP_EMPTY()));
>   
>   SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE,



  reply	other threads:[~2024-06-24  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24  6:12 [PATCH v2] ASoC: mediatek: mt8195: Add platform entry for ETDM1_OUT_BE dai link Chen-Yu Tsai
2024-06-24  7:39 ` AngeloGioacchino Del Regno [this message]
2024-06-25 11:33 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aefe76a3-5712-4e34-8990-0463a5036324@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=trevor.wu@mediatek.com \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox