Commit 48646550 authored by Cristian Ciocaltea's avatar Cristian Ciocaltea Committed by Mark Brown

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: 7b2f3eb4 ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: default avatarCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-10-cristian.ciocaltea@collabora.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 611b8813
...@@ -1625,8 +1625,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i ...@@ -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); ret = component_add(cs35l41->dev, &cs35l41_hda_comp_ops);
if (ret) { if (ret) {
dev_err(cs35l41->dev, "Register component failed: %d\n", ret); dev_err(cs35l41->dev, "Register component failed: %d\n", ret);
pm_runtime_disable(cs35l41->dev); goto err_pm;
goto err;
} }
dev_info(cs35l41->dev, "Cirrus Logic CS35L41 (%x), Revision: %02X\n", regid, reg_revid); dev_info(cs35l41->dev, "Cirrus Logic CS35L41 (%x), Revision: %02X\n", regid, reg_revid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment