[PATCH] ALSA: hda: cix-ipbloq: Fix runtime PM handling on probe failure
From: Sreeraj S Kurup
Date: Wed Dec 02 2026 - 04:41:47 EST
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@xxxxxxxxx>
---
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