summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2025-07-09 18:04:30 +0200
committerTakashi Iwai <tiwai@suse.de>2025-07-11 09:55:38 +0200
commit0c8e393941d25ea13a659f184c6dc76194a473b5 (patch)
tree1ce66f9ab303147721e133dfd1dbb4cfad5c1268
parent0c4eebafea5fefef264f2f8f1c88bbe1e53efedf (diff)
ALSA: hda: Return the codec init error properly at snd_hda_codec_build_controls()
The error from snd_hda_codec_init() was ignored in snd_hda_codec_build_controls(), which should have been taken account and abort the flow. Fix it now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-28-tiwai@suse.de
-rw-r--r--sound/hda/common/codec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/hda/common/codec.c b/sound/hda/common/codec.c
index fa07a296abe8..8e47769ef0ce 100644
--- a/sound/hda/common/codec.c
+++ b/sound/hda/common/codec.c
@@ -3065,14 +3065,16 @@ EXPORT_SYMBOL_GPL(snd_pcm_2_1_chmaps);
int snd_hda_codec_build_controls(struct hda_codec *codec)
{
struct hda_codec_driver *driver = hda_codec_to_driver(codec);
- int err = 0;
+ int err;
hda_exec_init_verbs(codec);
/* continue to initialize... */
err = snd_hda_codec_init(codec);
- if (!err) {
- if (driver->ops->build_controls)
- err = driver->ops->build_controls(codec);
+ if (err < 0)
+ return err;
+
+ if (driver->ops->build_controls) {
+ err = driver->ops->build_controls(codec);
if (err < 0)
return err;
}