From: sashiko-bot@kernel.org
To: "Tyler Baker" <tyler.baker@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card
Date: Fri, 06 Nov 2026 05:52:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-200869@kernel.org> (raw)
In-Reply-To: <20261106054333.2748248-2-tyler.baker@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] ASoC: soc-core: memory leak in snd_soc_of_get_dlc() [1]
--
commit fe7efa2dfe30cec1a0e194d20cca010f7a414abc
Author: Tyler Baker <tyler.baker@oss.qualcomm.com>
ASoC: soc-core: copy the DAI link names into the card
This commit duplicates the component DAI name onto the card device in
snd_soc_of_get_dai_link_codecs() and snd_soc_of_get_dai_link_cpus() so the
name remains valid across component unbind and rebind.
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index f33bece378b61..0e62965e35aaa 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
[ ... ]
> @@ -3282,6 +3294,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
> /* Parse the list */
> for_each_link_codecs(dai_link, index, component) {
> ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
> + if (!ret)
> + ret = snd_soc_of_dup_dai_name(dev, component);
> if (ret)
> goto err;
> }
[Severity: Medium]
This problem wasn't introduced by this patch, but does snd_soc_of_get_dlc()
[1] leak the device_node reference in args->np when snd_soc_get_dlc()
fails?
sound/soc/soc-core.c:snd_soc_of_get_dlc() {
if (!args)
args = &__args;
ret = of_parse_phandle_with_args(of_node, "sound-dai",
"#sound-dai-cells", index, args);
if (ret)
return ret;
return snd_soc_get_dlc(args, dlc);
}
of_parse_phandle_with_args() acquires a reference on args->np, which
snd_soc_get_dlc() only transfers to dlc->of_node on success. When
snd_soc_get_dlc() fails (for example with -EPROBE_DEFER) and the caller
passed a NULL args pointer as done here and in
snd_soc_of_get_dai_link_cpus(), __args goes out of scope without
of_node_put() being called.
[1] https://sashiko.dev/#/bug/linux-11ae6ad5-0cce-4928-9290-e7723e9f7638
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106054333.2748248-1-tyler.baker@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-11-06 5:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 5:43 [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Tyler Baker
2026-11-06 5:43 ` [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card Tyler Baker
2026-11-06 5:52 ` sashiko-bot [this message]
2026-11-06 5:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
2026-11-06 6:01 ` sashiko-bot
2026-11-09 12:33 ` [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart 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=sashiko-outbox-200869@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tyler.baker@oss.qualcomm.com \
/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