All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tristan Madani" <tristmd@gmail.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 4/4] ASoC: wm8994: drain all delayed works on component remove
Date: Mon, 26 Oct 2026 12:57:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-185252@kernel.org> (raw)
In-Reply-To: <20261026112212.2519775-5-tristmd@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ASoC: wm8994: uninitialized mic_work cancel in wm8994_component_remove()
--

commit fac5aa258b308d77c115320a9d762e1310e3f8f2
Author: Tristan Madani <tristan@talencesecurity.com>

ASoC: wm8994: drain all delayed works on component remove

This commit cancels jackdet_bootstrap, mic_complete_work, mic_work, and
open_circuit_work synchronously in wm8994_component_remove() after freeing
IRQs and before releasing firmware.

> diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
> index 6b91e02f130b3..59b9cdcd5fc6a 100644
> --- a/sound/soc/codecs/wm8994.c
> +++ b/sound/soc/codecs/wm8994.c
> @@ -4636,6 +4636,10 @@ static void wm8994_component_remove(struct snd_soc_component *component)
>  			free_irq(wm8994->micdet_irq, wm8994);
>  		break;
>  	}
> +	cancel_delayed_work_sync(&wm8994->jackdet_bootstrap);
> +	cancel_delayed_work_sync(&wm8994->mic_complete_work);
> +	cancel_delayed_work_sync(&wm8994->mic_work);

[Severity: High]
In sound/soc/codecs/wm8994.c, wm8994_component_probe() only initializes
wm8994->mic_work when control->type is WM8994 or WM1811:

	switch (control->type) {
	case WM8994:
		INIT_DELAYED_WORK(&wm8994->mic_work, wm8994_mic_work);
		break;
	case WM1811:
		INIT_DELAYED_WORK(&wm8994->mic_work, wm1811_mic_work);
		break;
	default:
		break;
	}

When control->type is WM8958, wm8994->mic_work is left zero-initialized
with work.func == NULL and an uninitialized timer.

Won't calling cancel_delayed_work_sync(&wm8994->mic_work) unconditionally
in wm8994_component_remove() on a WM8958 device trigger WARN_ON(!work->func)
via __cancel_work_sync() -> __flush_work(), as well as an uninitialized
timer warning in timer_delete() when debug objects are enabled?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261026112212.2519775-1-tristmd@gmail.com?part=4

  reply	other threads:[~2026-10-26 12:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 11:22 [PATCH 0/4] ASoC: cancel pending delayed works on component remove Tristan Madani
2026-10-26 11:22 ` [PATCH 1/4] ASoC: rt5668: " Tristan Madani
2026-10-26 12:21   ` sashiko-bot
2026-10-26 11:22 ` [PATCH 2/4] ASoC: rt5659: cancel jack_detect_work " Tristan Madani
2026-10-26 12:41   ` sashiko-bot
2026-10-26 19:16   ` Mark Brown
2026-10-26 11:22 ` [PATCH 3/4] ASoC: twl6040: cancel headset jack work " Tristan Madani
2026-10-26 11:22 ` [PATCH 4/4] ASoC: wm8994: drain all delayed works " Tristan Madani
2026-10-26 12:57   ` sashiko-bot [this message]
2026-10-26 19:16   ` Mark Brown
2026-10-29 10:25 ` [PATCH v9] ASoC: wm8994: drain delayed works on remove and probe error Tristan Madani
2026-10-29 10:42   ` sashiko-bot
2026-10-29 10:57   ` [PATCH v10] " Tristan Madani
2026-10-29 11:11     ` sashiko-bot
2026-10-29 11:18     ` Mark Brown
2026-10-29 11:10   ` [PATCH v9] " 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-185252@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tristmd@gmail.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 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.