Skip to content

Commit 0c8e393

Browse files
committed
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 <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0c4eeba commit 0c8e393

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sound/hda/common/codec.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,14 +3065,16 @@ EXPORT_SYMBOL_GPL(snd_pcm_2_1_chmaps);
30653065
int snd_hda_codec_build_controls(struct hda_codec *codec)
30663066
{
30673067
struct hda_codec_driver *driver = hda_codec_to_driver(codec);
3068-
int err = 0;
3068+
int err;
30693069

30703070
hda_exec_init_verbs(codec);
30713071
/* continue to initialize... */
30723072
err = snd_hda_codec_init(codec);
3073-
if (!err) {
3074-
if (driver->ops->build_controls)
3075-
err = driver->ops->build_controls(codec);
3073+
if (err < 0)
3074+
return err;
3075+
3076+
if (driver->ops->build_controls) {
3077+
err = driver->ops->build_controls(codec);
30763078
if (err < 0)
30773079
return err;
30783080
}

0 commit comments

Comments
 (0)