Skip to contentSkip to conversation

ALSA: echoaudio: Fix improper return value in function load_asic

PATCH New Takashi Iwai 1 participant 1 message Nov 29, 2016 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: echoaudio: Fix improper return value in function load_asic

From: Pan Bian <[email protected]>

When the second call to load_asic_generic() fails in function load_asic(), "false" is returned. The real value of "false" is 0, which indicates success in the context. As a result, the execution status and the return value may be inconsistent. This patch fixes the bug.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188761

---
 sound/pci/echoaudio/layla24_dsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/echoaudio/layla24_dsp.c +1 -1
index df28e5117359..c02bc1dcc170 100644
@@ -135,7 +135,7 @@ static int load_asic(struct echoaudio *chip)
 	err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_EXTERNAL_ASIC,
 				FW_LAYLA24_2S_ASIC);
 	if (err < 0)
-		return false;
+		return err;
 
 	/* Now give the external ASIC a little time to set up */
 	mdelay(10);
Signature · 1 line
2.10.2