diff mbox series

[next] ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp()

Message ID 20231030070836.3234385-1-harshit.m.mogalapalli@oracle.com (mailing list archive)
State Accepted
Commit dc6e08b1a2ae262c23e14f5c259b4ca63a554e4f
Headers show
Series [next] ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() | expand

Commit Message

Harshit Mogalapalli Oct. 30, 2023, 7:08 a.m. UTC
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>
---
This is found using smatch and only compile tested.
---
 sound/pci/hda/cs35l41_hda.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 496ff6a9d300..09f8d8fa4c71 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -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;
 	}