Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH v3 12/27] ASoC: soc-component: move devm_snd_soc_component_register()
Date: Wed, 25 Nov 2026 01:57:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-232374@kernel.org> (raw)
In-Reply-To: <87se0pele4.wl-kuninori.morimoto.gx@renesas.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] ASoC: soc-component: double list_del() in
  devm_component_release()
- [Low] ASoC: soc-component: wrong function name in commit subject
--

commit bfd525c567e53a1ebadf8315dc6aad399a16e15a
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: soc-component: move devm_snd_soc_component_register()

This commit moves devm_snd_soc_register_component() and its devres release
callback from sound/soc/soc-devres.c to sound/soc/soc-component.c.

> ASoC: soc-component: move devm_snd_soc_component_register()

[Severity: Low]
This isn't a bug, but the function moved by this patch is
devm_snd_soc_register_component() rather than
devm_snd_soc_component_register().

> diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
> index ca51f976ec409..ea8ed0a662dc6 100644
> --- a/sound/soc/soc-component.c
> +++ b/sound/soc/soc-component.c
> @@ -1766,3 +1766,54 @@ void snd_soc_unregister_component(struct device *dev)
>  	}
>  }
>  EXPORT_SYMBOL_GPL(snd_soc_unregister_component);
> +
> +static void devm_component_release(struct device *dev, void *res)
> +{
> +	struct snd_soc_component **component = res;
> +
> +	snd_soc_component_unregister(*component);
> +}

[Severity: High]
Can devm_component_release() unregister *component a second time and run
list_del(&component->list) on an already-poisoned list head?

Together with commit "ASoC: soc-devres: use snd_soc_component_unregister()
for devm_snd_soc_register_component()" earlier in this series, devres now
stores the component pointer and calls snd_soc_component_unregister()
directly instead of looking the component up on component_list via
snd_soc_unregister_component_by_driver().

In sound/soc/stm/stm32_adfsdm.c, stm32_adfsdm_probe() registers a DAI
component on &pdev->dev with devm_snd_soc_register_component() and a
platform component on the same device with snd_soc_register_component().
On detach, stm32_adfsdm_remove() runs before devres release and calls
snd_soc_unregister_component(&pdev->dev), which unregisters every
component attached to &pdev->dev and deletes component->list.  When
devres_release_all() then invokes devm_component_release(),
snd_soc_component_unregister(*component) calls list_del(&component->list)
again, causing a list corruption crash or warning.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/87a4mxg01k.wl-kuninori.morimoto.gx@renesas.com?part=12

  reply	other threads:[~2026-11-25  1:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  1:41 [PATCH v3 00/27] ASoC: add new Component functions Kuninori Morimoto
2026-11-25  1:41 ` [PATCH v3 01/27] ASoC: soc-generic-dmaengine-pcm: move devm_snd_dmaengine_pcm_register() Kuninori Morimoto
2026-11-25  1:41 ` [PATCH v3 02/27] ASoC: soc-component: rename snd_soc_component_{init/exit}_regmap() to snd_soc_component_regmap_{init/exit}() Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 03/27] ASoC: soc-component: rename snd_soc_component_regmap_val_bytes() Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 04/27] ASoC: soc-component: rename snd_soc_component_regmap_cache_sync() Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 05/27] ASoC: soc-component: align snd_soc_component_{regmap/regcache}_xxx() functions Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 06/27] ASoC: soc-core: move snd_soc_del_component_unlocked() Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 07/27] ASoC: soc-core: add missing snd_soc_component_unregister() Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 08/27] ASoC: soc-generic-dmaengine-pcm: use snd_soc_component_unregister() Kuninori Morimoto
2026-11-25  1:42 ` [PATCH v3 09/27] ASoC: soc-devres: use snd_soc_component_unregister() for devm_snd_soc_register_component() Kuninori Morimoto
2026-11-25  2:02   ` sashiko-bot
2026-11-25  1:43 ` [PATCH v3 10/27] ASoC: soc-core: remove snd_soc_unregister_component_by_driver() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 11/27] ASoC: soc-component: move snd_soc_register_[un]component() to soc-component.c Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 12/27] ASoC: soc-component: move devm_snd_soc_component_register() Kuninori Morimoto
2026-11-25  1:57   ` sashiko-bot [this message]
2026-11-25  1:43 ` [PATCH v3 13/27] ASoC: soc-component: move snd_soc_of_xlate_dai_name() to soc-component.c Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 14/27] ASoC: soc-component: add snd_soc_component_name_prefix() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 15/27] ASoC: soc-component: add snd_soc_component_to_dev() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 16/27] ASoC: soc-component: add snd_soc_component_to_driver() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 17/27] ASoC: soc-component: add snd_soc_component_to_card() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 18/27] ASoC: soc-component: add snd_soc_component_to_debugfs_root() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 19/27] ASoC: soc-component: add snd_soc_component_to_regmap() Kuninori Morimoto
2026-11-25  1:43 ` [PATCH v3 20/27] ASoC: soc-component: add snd_soc_component_regcache_mark_dirty() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 21/27] ASoC: soc-component: add snd_soc_component_regcache_cache_only() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 22/27] ASoC: soc-component: add snd_soc_component_regcache_cache_bypass() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 23/27] ASoC: soc-component: add snd_soc_component_regmap_multi_reg_write_bypassed() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 24/27] ASoC: soc-component: add snd_soc_component_num_dai() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 25/27] ASoC: soc-component: add snd_soc_component_connect_dai() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 26/27] ASoC: soc-component: add snd_soc_component_active_update() Kuninori Morimoto
2026-11-25  1:44 ` [PATCH v3 27/27] ASoC: soc-component: add snd_soc_component_device_link_{add/del}() Kuninori Morimoto

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-232374@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.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