Skip to content

Commit ff0045d

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: codecs: hda: Fix RPM usage count underflow
RPM manipulation in hda_codec_probe_complete()'s error path is superfluous and leads to RPM usage count underflow if the build-controls operation fails. hda_codec_probe_complete() is called in: 1) hda_codec_probe() for all non-HDMI codecs 2) in card->late_probe() for HDMI codecs Error path for hda_codec_probe() takes care of bus' RPM already. For 2) if late_probe() fails, ASoC performs card cleanup what triggers hda_codec_remote() - same treatment is in 1). Fixes: b5df2a7 ("ASoC: codecs: Add HD-Audio codec driver") Reviewed-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent df79960 commit ff0045d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/codecs/hda.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ int hda_codec_probe_complete(struct hda_codec *codec)
152152
ret = snd_hda_codec_build_controls(codec);
153153
if (ret < 0) {
154154
dev_err(&hdev->dev, "unable to create controls %d\n", ret);
155-
goto out;
155+
return ret;
156156
}
157157

158158
/* Bus suspended codecs as it does not manage their pm */
159159
pm_runtime_set_active(&hdev->dev);
160160
/* rpm was forbidden in snd_hda_codec_device_new() */
161161
snd_hda_codec_set_power_save(codec, 2000);
162162
snd_hda_codec_register(codec);
163-
out:
163+
164164
/* Complement pm_runtime_get_sync(bus) in probe */
165165
pm_runtime_mark_last_busy(bus->dev);
166166
pm_runtime_put_autosuspend(bus->dev);

0 commit comments

Comments
 (0)