Function load_asic_generic() returns a negative value on failure. In the function load_asic() defined in file sound/pci/echoaudio/layla24_dsp.c, the return value of load_asic_generic() is checked (at line 137). However, it returns false (real value of which is 0, indicates success) when load_asic_generic() returns a negative value. Maybe the author intends to return "err". Codes related to this bug are summarised as follows. load_asic @@ sound/pci/echoaudio/layla24_dsp.c 112 static int load_asic(struct echoaudio *chip) 113 { 114 int err; 115 116 if (chip->asic_loaded) 117 return 1; ... 133 134 /* Do the external one */ 135 err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA24_EXTERNAL_ASIC, 136 FW_LAYLA24_2S_ASIC); 137 if (err < 0) 138 return false; // return err? 139 140 /* Now give the external ASIC a little time to set up */ 141 mdelay(10); 142 143 /* See if it worked */ 144 err = check_asic_status(chip); 145 146 /* Set up the control register if the load succeeded - 147 48 kHz, internal clock, S/PDIF RCA mode */ 148 if (!err) 149 err = write_control_reg(chip, GML_CONVERTER_ENABLE | GML_48KHZ, 150 true); 151 152 return err; 153 } Thanks very much!
Yes, obviously it's a logic failure. Care to submit a fix patch? Thanks!
Created attachment 246141 [details] Fix the bug 188761 This patch fixes the bug 188761. Replace "return false;" with "return err;" at line 138. Thanks for your attention!
Thanks! I submitted the patch to ML, and am going to merge it later.