All of lore.kernel.org
 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 09/27] ASoC: soc-devres: use snd_soc_component_unregister() for devm_snd_soc_register_component()
Date: Wed, 25 Nov 2026 02:02:10 +0000	[thread overview]
Message-ID: <sashiko-outbox-232386@kernel.org> (raw)
In-Reply-To: <87wlq1eley.wl-kuninori.morimoto.gx@renesas.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] ASoC: soc-devres: double list_del() in devm_component_release()
  on teardown
--

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

ASoC: soc-devres: use snd_soc_component_unregister() for devm_snd_soc_register_component()

This commit updates devm_snd_soc_register_component() to store the created
component pointer in devres and call snd_soc_component_unregister() on
release.

> diff --git a/sound/soc/soc-devres.c b/sound/soc/soc-devres.c
> index ca6c29b54f6ab..0323897c664dc 100644
> --- a/sound/soc/soc-devres.c
> +++ b/sound/soc/soc-devres.c
> @@ -11,9 +11,9 @@
>  
>  static void devm_component_release(struct device *dev, void *res)
>  {
> -	const struct snd_soc_component_driver **cmpnt_drv = res;
> +	struct snd_soc_component **component = res;
>  
> -	snd_soc_unregister_component_by_driver(dev, *cmpnt_drv);
> +	snd_soc_component_unregister(*component);
>  }

[Severity: High]
Can this run list_del(&component->list) a second time when a driver
registers a component via devm_snd_soc_register_component() and also calls
snd_soc_unregister_component(dev) in its remove path?

Previously, snd_soc_unregister_component_by_driver() looked up the
component on component_list first, so devm_component_release() was a
no-op if the component had already been removed.  Now
snd_soc_component_unregister() unconditionally calls
snd_soc_component_unregister_unlocked() -> list_del(&component->list).

For example, sound/soc/stm/stm32_adfsdm.c registers
stm32_adfsdm_dai_component with devm_snd_soc_register_component() in
stm32_adfsdm_probe() and calls snd_soc_unregister_component(&pdev->dev) in
stm32_adfsdm_remove(), which unregisters all components on the device
before devres_release_all() runs devm_component_release(), causing a
double list_del() on the poisoned list head during unbind or module
unload.

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

  reply	other threads:[~2026-11-25  2:02 UTC|newest]

Thread overview: 31+ 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 [this message]
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
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
2026-11-25 18:01 ` [PATCH v3 00/27] ASoC: add new Component functions 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-232386@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.