Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vijendar Mukunda" <Vijendar.Mukunda@amd.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH v3 07/13] ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver
Date: Fri, 23 Oct 2026 07:10:28 +0000	[thread overview]
Message-ID: <sashiko-outbox-182386@kernel.org> (raw)
In-Reply-To: <20261023065216.3473883-8-Vijendar.Mukunda@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ASoC: amd: acp: missing asoc_sdw_mc_dailink_exit_loop() in mc_probe()
--

commit 418fccdf2ffaf02e2c03c094859e73443fbe31c7
Author: Vijendar Mukunda <Vijendar.Mukunda@amd.com>

ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver

This commit appends the DMIC component and mic count string to
card->components in mc_probe() when a DMIC DAI link is created by
sof_card_dai_links_create().

> diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c
> index 5c201d0b3bef9..4c171e52410a6 100644
> --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c
> +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c

[ ... ]

> @@ -489,6 +489,17 @@ static int mc_probe(struct platform_device *pdev)
>  	if (!card->components)
>  		return -ENOMEM;
>  
> +	if ((sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach->mach_params.dmic_num ||
> +	     amd_ctx->pdm_sel) && !ctx->ignore_internal_dmic) {
> +		dmic_num = mach->mach_params.dmic_num ? mach->mach_params.dmic_num : 1;
> +		card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
> +						  "%s mic:acp-dmic cfg-mics:%d",
> +						  card->components,
> +						  dmic_num);
> +		if (!card->components)
> +			return -ENOMEM;
> +	}

[Severity: Medium]
If devm_kasprintf() fails here (as well as in the preceding allocation for
cfg-amp), does returning -ENOMEM directly leak the SoundWire codec device
references and software nodes initialized during sof_card_dai_links_create()?

Earlier in sound/soc/amd/acp/acp-sdw-sof-mach.c:mc_probe(),
sof_card_dai_links_create() invokes the endpoint .init callbacks via
create_sdw_dailinks() -> create_sdw_dailink(), such as
sound/soc/sdw_utils/soc_sdw_rt711.c:asoc_sdw_rt711_init():

	sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, dai_links->codecs[0].name);
	if (!sdw_dev)
		return -EPROBE_DEFER;

	ret = rt711_add_codec_device_props(sdw_dev, ctx->mc_quirk);
	if (ret < 0) {
		put_device(sdw_dev);
		return ret;
	}
	ctx->headset_codec_dev = sdw_dev;

When devm_snd_soc_register_card() fails right below in mc_probe(), it cleans
these up with asoc_sdw_mc_dailink_exit_loop(card):

	ret = devm_snd_soc_register_card(&pdev->dev, card);
	if (ret) {
		dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed %d\n", ret);
		asoc_sdw_mc_dailink_exit_loop(card);
		return ret;
	}

Should the devm_kasprintf() failure path also call
asoc_sdw_mc_dailink_exit_loop(card) before returning -ENOMEM?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023065216.3473883-1-Vijendar.Mukunda@amd.com?part=7

  reply	other threads:[~2026-10-23  7:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  6:50 [PATCH v3 00/13] ASoC: amd: acp: ACP7.B/7.F SoundWire machine driver support Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 01/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver Vijendar Mukunda
2026-10-25 20:59   ` Pierre-Louis Bossart
2026-10-29  3:45     ` Mukunda,Vijendar
2026-10-23  6:50 ` [PATCH v3 02/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support Vijendar Mukunda
2026-10-25 21:11   ` Pierre-Louis Bossart
2026-10-29  4:56     ` Mukunda,Vijendar
2026-10-29  8:07       ` Pierre-Louis Bossart
2026-10-23  6:50 ` [PATCH v3 03/13] ASoC: amd: acp: add PDM controller selection for ACP7.B/7.F SoundWire machine driver Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 04/13] ASoC: amd: acp: log ASOC_SDW_ACP_DMIC1 quirk in SOF " Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 05/13] ASoC: amd: acp: enable DMIC DAI link based on PDM controller selection Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 06/13] ASoC: amd: acp: move ignore_internal_dmic gate to DMIC enable condition Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 07/13] ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver Vijendar Mukunda
2026-10-23  7:10   ` sashiko-bot [this message]
2026-10-23  8:10     ` Mukunda,Vijendar
2026-10-23  6:50 ` [PATCH v3 08/13] ASoC: amd: acp: set PCI subsystem ID " Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 09/13] ASoC: amd: acp: fix MODULE_AUTHOR missing closing angle bracket Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 10/13] ASoC: amd: acp: add ACPI machine tables for ACP7.F SoundWire Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 11/13] ASoC: SOF: amd: add alt_machines for ACP7.F SOF SoundWire Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 12/13] ASoC: amd: acp: add SoundWire machine table for ACP7.B platform Vijendar Mukunda
2026-10-23  6:50 ` [PATCH v3 13/13] ASoC: SOF: amd: register SoundWire alt_machines for ACP7.B Vijendar Mukunda

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-182386@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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