* [PATCH] ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe()
@ 2026-09-16 7:27 Wentao Liang
2026-09-16 10:02 ` Charles Keepax
2026-09-16 21:07 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-09-16 7:27 UTC (permalink / raw)
To: broonie
Cc: ckeepax, krzk, lgirdwood, linux-kernel, linux-sound, patches,
perex, s.nawrocki, tiwai, Wentao Liang, stable
In wm8994_component_probe(), pm_runtime_get_sync() is invoked before
reading the GPIO configuration registers. If either regmap_read() fails,
the function jumps to err_irq without calling pm_runtime_put(), leaving
the runtime PM usage count incremented and causing a leak.
Add pm_runtime_put() on both GPIO read failure paths before jumping to
err_irq.
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 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 1d64c7c42ed1..7a790f5e33f1 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -4354,6 +4354,7 @@ static int wm8994_component_probe(struct snd_soc_component *component)
ret = regmap_read(control->regmap, WM8994_GPIO_1, ®);
if (ret < 0) {
dev_err(component->dev, "Failed to read GPIO1 state: %d\n", ret);
+ pm_runtime_put(component->dev);
goto err_irq;
}
if ((reg & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) {
@@ -4366,6 +4367,7 @@ static int wm8994_component_probe(struct snd_soc_component *component)
ret = regmap_read(control->regmap, WM8994_GPIO_6, ®);
if (ret < 0) {
dev_err(component->dev, "Failed to read GPIO6 state: %d\n", ret);
+ pm_runtime_put(component->dev);
goto err_irq;
}
if ((reg & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) {
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe()
2026-09-16 7:27 [PATCH] ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe() Wentao Liang
@ 2026-09-16 10:02 ` Charles Keepax
2026-09-16 21:07 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2026-09-16 10:02 UTC (permalink / raw)
To: Wentao Liang
Cc: broonie, krzk, lgirdwood, linux-kernel, linux-sound, patches,
perex, s.nawrocki, tiwai, stable
On Wed, Sep 16, 2026 at 07:27:37AM +0000, Wentao Liang wrote:
> In wm8994_component_probe(), pm_runtime_get_sync() is invoked before
> reading the GPIO configuration registers. If either regmap_read() fails,
> the function jumps to err_irq without calling pm_runtime_put(), leaving
> the runtime PM usage count incremented and causing a leak.
>
> Add pm_runtime_put() on both GPIO read failure paths before jumping to
> err_irq.
>
> 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: wm8994: Fix runtime PM imbalance in wm8994_component_probe()
2026-09-16 7:27 [PATCH] ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe() Wentao Liang
2026-09-16 10:02 ` Charles Keepax
@ 2026-09-16 21:07 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-09-16 21:07 UTC (permalink / raw)
To: Wentao Liang
Cc: ckeepax, krzk, lgirdwood, linux-kernel, linux-sound, patches,
perex, s.nawrocki, tiwai, stable
On Wed, 16 Sep 2026 07:27:37 +0000, Wentao Liang wrote:
> ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe()
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe()
https://git.kernel.org/broonie/sound/c/480a5528cb62
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-17 11:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 7:27 [PATCH] ASoC: wm8994: Fix runtime PM imbalance in wm8994_component_probe() Wentao Liang
2026-09-16 10:02 ` Charles Keepax
2026-09-16 21:07 ` Mark Brown
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.