From: Cristian Ciocaltea cristian.ciocaltea@collabora.com
stable inclusion from stable-v6.6.2 commit d3af600c72529a39f98c61585ab58e06affbf44a category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8IW7G
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
[ Upstream commit 486465508f8a5fe441939a7d97607f4460a60891 ]
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@collabora.com Reviewed-by: Takashi Iwai tiwai@suse.de Link: https://lore.kernel.org/r/20230907171010.1447274-10-cristian.ciocaltea@colla... Signed-off-by: Mark Brown broonie@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org Signed-off-by: Zheng Zengkai zhengzengkai@huawei.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 055ebfc23735..ebf9ddbb2605 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -1668,8 +1668,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);