mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect()
@ 2026-09-17 16:51 Wentao Liang
  2026-09-18 14:57 ` Charles Keepax
  2026-09-18 17:09 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-09-17 16:51 UTC (permalink / raw)
  To: broonie
  Cc: ckeepax, krzk, lgirdwood, linux-kernel, linux-sound, patches,
	perex, s.nawrocki, tiwai, Wentao Liang, stable

wm8994_mic_detect() resumes the component before configuring the MICBIAS
pins, but the default case of the micbias switch returns -EINVAL right
after taking that reference, skipping the pm_runtime_put() on the
success path. This leaks a runtime PM reference on every call with an
invalid micbias.

Release the reference before returning -EINVAL.

Fixes: f5a2cda4f1db ("ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 sound/soc/codecs/wm8994.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 1d64c7c42ed1..bfbb8a56b563 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3535,6 +3535,7 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *
 		break;
 	default:
 		dev_warn(component->dev, "Invalid MICBIAS %d\n", micbias);
+		pm_runtime_put(component->dev);
 		return -EINVAL;
 	}
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect()
  2026-09-17 16:51 [PATCH] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect() Wentao Liang
@ 2026-09-18 14:57 ` Charles Keepax
  2026-09-18 17:09 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2026-09-18 14:57 UTC (permalink / raw)
  To: Wentao Liang
  Cc: broonie, krzk, lgirdwood, linux-kernel, linux-sound, patches,
	perex, s.nawrocki, tiwai, stable

On Thu, Sep 17, 2026 at 04:51:30PM +0000, Wentao Liang wrote:
> wm8994_mic_detect() resumes the component before configuring the MICBIAS
> pins, but the default case of the micbias switch returns -EINVAL right
> after taking that reference, skipping the pm_runtime_put() on the
> success path. This leaks a runtime PM reference on every call with an
> invalid micbias.
> 
> Release the reference before returning -EINVAL.
> 
> Fixes: f5a2cda4f1db ("ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect()
  2026-09-17 16:51 [PATCH] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect() Wentao Liang
  2026-09-18 14:57 ` Charles Keepax
@ 2026-09-18 17:09 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-09-18 17:09 UTC (permalink / raw)
  To: Wentao Liang
  Cc: ckeepax, krzk, lgirdwood, linux-kernel, linux-sound, patches,
	perex, s.nawrocki, tiwai, stable

On Thu, 17 Sep 2026 16:51:30 +0000, Wentao Liang wrote:
> ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect()

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[1/1] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect()
      https://git.kernel.org/broonie/sound/c/b2c0e5bf750e

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-18 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 16:51 [PATCH] ASoC: codecs: wm8994: Fix runtime PM leak in wm8994_mic_detect() Wentao Liang
2026-09-18 14:57 ` Charles Keepax
2026-09-18 17:09 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®