From: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
To: perex@perex.cz, tiwai@suse.de, gary.yang@cixtech.com,
fugang.duan@cixtech.com, cix-kernel-upstream@cixtech.com
Cc: linux-sound@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Subject: [PATCH] ALSA: hda: cix-ipbloq: Fix runtime PM handling on probe failure
Date: Wed, 2 Dec 2026 09:40:26 +0000 [thread overview]
Message-ID: <20261202094026.4432-1-sreekuttan2156239@gmail.com> (raw)
The driver enables runtime PM before calling
pm_runtime_resume_and_get().
If cix_ipbloq_hda_init() or cix_ipbloq_hda_probe_codec()
fails, the runtime PM usage reference is not released.
Release the reference on these failure paths and disable
runtime PM before freeing the ALSA device and card.
Also disable runtime PM if pm_runtime_resume_and_get()
fails, as runtime PM was already enabled.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/hda/controllers/cix-ipbloq.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/hda/controllers/cix-ipbloq.c b/sound/hda/controllers/cix-ipbloq.c
index f73d6216bce3..d1cb9c01aa16 100644
--- a/sound/hda/controllers/cix-ipbloq.c
+++ b/sound/hda/controllers/cix-ipbloq.c
@@ -284,21 +284,25 @@ static int cix_ipbloq_hda_probe(struct platform_device *pdev)
err = pm_runtime_resume_and_get(hda->dev);
if (err < 0) {
dev_err(hda->dev, "runtime resume and get failed, err = %d\n", err);
- goto out_free_device;
+ goto out_pm_disable;
}
err = cix_ipbloq_hda_init(hda, chip, pdev);
if (err < 0)
- goto out_free_device;
+ goto out_pm_put;
err = cix_ipbloq_hda_probe_codec(hda);
if (err < 0)
- goto out_free_device;
+ goto out_pm_put;
pm_runtime_put(hda->dev);
return 0;
+out_pm_put:
+ pm_runtime_put_sync(hda->dev);
+out_pm_disable:
+ pm_runtime_disable(hda->dev);
out_free_device:
snd_device_free(card, chip);
out_free_card:
--
2.55.0
next reply other threads:[~2026-12-02 9:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 9:40 Sreeraj S Kurup [this message]
2026-12-02 10:23 ` [PATCH v2] " Sreeraj S Kurup
2026-12-02 10:35 ` [PATCH v3] " Sreeraj S Kurup
2026-12-02 11:58 ` Sreeraj S Kurup
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=20261202094026.4432-1-sreekuttan2156239@gmail.com \
--to=sreekuttan2156239@gmail.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=fugang.duan@cixtech.com \
--cc=gary.yang@cixtech.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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®