mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wentao Liang <vulab@iscas.ac.cn>
To: broonie@kernel.org
Cc: ckeepax@opensource.cirrus.com, cw00.choi@samsung.com,
	lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	perex@perex.cz, tiwai@suse.com, Wentao Liang <vulab@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: [PATCH] ASoC: arizona-jack: Fix runtime PM leak in arizona_start_mic()
Date: Thu, 17 Sep 2026 16:46:25 +0000	[thread overview]
Message-ID: <20260917164625.2163097-1-vulab@iscas.ac.cn> (raw)

arizona_start_mic() takes a runtime PM reference before enabling mic
detection, but the error path taken when regmap_update_bits_check()
fails returns without releasing it, since pm_runtime_put_autosuspend()
is only called in the !change branch. This leaks a runtime PM reference
whenever the register write fails.

Release the reference on the error path as well.

Fixes: fbdc60b2a787 ("extcon: arizona: Correct error handling on regmap_update_bits_check")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 sound/soc/codecs/arizona-jack.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/arizona-jack.c b/sound/soc/codecs/arizona-jack.c
index a9063bac2752..09a100846fdb 100644
--- a/sound/soc/codecs/arizona-jack.c
+++ b/sound/soc/codecs/arizona-jack.c
@@ -274,6 +274,7 @@ static void arizona_start_mic(struct arizona_priv *info)
 				       &change);
 	if (ret < 0) {
 		dev_err(arizona->dev, "Failed to enable micd: %d\n", ret);
+		pm_runtime_put_autosuspend(arizona->dev);
 	} else if (!change) {
 		regulator_disable(info->micvdd);
 		pm_runtime_put_autosuspend(arizona->dev);
-- 
2.34.1


             reply	other threads:[~2026-09-17 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 16:46 Wentao Liang [this message]
2026-09-18 15:05 ` Charles Keepax
2026-11-08 11:46   ` Wentao Liang
2026-11-09 11:22     ` Charles Keepax

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=20260917164625.2163097-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=cw00.choi@samsung.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.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 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®