[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230907171010.1447274-10-cristian.ciocaltea@collabora.com>
Date: Thu, 7 Sep 2023 20:10:08 +0300
From: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
To: James Schulman <james.schulman@...rus.com>,
David Rhodes <david.rhodes@...rus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Stefan Binding <sbinding@...nsource.cirrus.com>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
Vitaly Rodionov <vitalyr@...nsource.cirrus.com>
Cc: alsa-devel@...a-project.org, patches@...nsource.cirrus.com,
linux-kernel@...r.kernel.org, kernel@...labora.com
Subject: [PATCH v2 09/11] ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get()
If component_add() fails, probe() returns without calling
pm_runtime_put(), which leaves the runtime PM usage counter incremented.
Fix the issue by jumping to err_pm label and drop the now unnecessary
pm_runtime_disable() call.
Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
---
sound/pci/hda/cs35l41_hda.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 09a9c135d9b6..6fd827093c92 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -1625,8 +1625,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i
ret = component_add(cs35l41->dev, &cs35l41_hda_comp_ops);
if (ret) {
dev_err(cs35l41->dev, "Register component failed: %d\n", ret);
- pm_runtime_disable(cs35l41->dev);
- goto err;
+ goto err_pm;
}
dev_info(cs35l41->dev, "Cirrus Logic CS35L41 (%x), Revision: %02X\n", regid, reg_revid);
--
2.41.0
Powered by blists - more mailing lists