ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Mon, 30 Oct 2023 07:08:36 +0000 (00:08 -0700)
committerTakashi Iwai <tiwai@suse.de>
Tue, 31 Oct 2023 17:30:16 +0000 (18:30 +0100)
When firmware status is invalid, assign -EINVAL to ret as ret is '0' at
that point and returning success is incorrect when firmware status is
invalid.

Fixes: a51d8ba03a4f ("ALSA: hda: cs35l41: Check CSPL state after loading firmware")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20231030070836.3234385-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda.c

index 98a5123e9f50df2e197b4a84367844f6c8b7b154..b2db8091f0ed65e33ab3acbe4ae0b33e22e991fe 100644 (file)
@@ -1042,6 +1042,7 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
        default:
                dev_err(cs35l41->dev, "Firmware status is invalid: %u\n",
                        fw_status);
+               ret = -EINVAL;
                goto clean_dsp;
        }