ASoC: wm_adsp: Check return value from wm_adsp_buffer_init
Subsystems (3)
PATCH 1/1 ASoC: wm_adsp: Check return value from wm_adsp_buffer_init
We are not checking the return value from a call to wm_adsp_buffer_init it looks like this used to be returned at the bottom of the function but probably got missed when more error paths were added. This patch adds the appropriate error check.
--- sound/soc/codecs/wm_adsp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +4 -1
@@ -2580,8 +2580,11 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,mutex_lock (&dsp->pwr_lock); -if (wm_adsp_fw[dsp->fw].num_caps !=0 ) +if (wm_adsp_fw[dsp->fw].num_caps !=0 ) { ret =wm_adsp_buffer_init (dsp); +if (ret <0 ) + goto err; + }mutex_unlock (&dsp->pwr_lock);
Signature · 1 line
2.1.4
Charles,
Quoted 15 lines · Charles Keepax
We are not checking the return value from a call to
wm_adsp_buffer_initit looks like this used to be returned at the bottom of the function but probably got missed when more error paths were added. This patch adds the appropriate error check.Signed-off-by Charles Keepax <[email protected]>--- sound/soc/codecs/wm_adsp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)sound/soc/codecs/wm_adsp.c +0
-0
sound/soc/codecs/wm_adsp.c int wm_adsp2_event(struct snd_soc_dapm_widget *w, · line 2587
Quoted 9 lines
sound/soc/codecs/wm_adsp.c +4
-1@@ -2580,8 +2580,11 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,mutex_lock (&dsp->pwr_lock); -if (wm_adsp_fw[dsp->fw].num_caps !=0 ) +if (wm_adsp_fw[dsp->fw].num_caps !=0 ) { ret =wm_adsp_buffer_init (dsp); +if (ret <0 ) + goto err; + }
Need to call mutex_unlock() before jumping to err label?
sound/soc/codecs/wm_adsp.c int wm_adsp2_event(struct snd_soc_dapm_widget *w, · line 2589
Quoted 2 lines
sound/soc/codecs/wm_adsp.c +0
-0mutex_unlock (&dsp->pwr_lock);
Regards
Takashi Sakamoto
Quoted 21 lines · Takashi Sakamoto
Charles,
Quoted 18 lines · Charles Keepax
We are not checking the return value from a call to
wm_adsp_buffer_initit looks like this used to be returned at the bottom of the function but probably got missed when more error paths were added. This patch adds the appropriate error check.Signed-off-by Charles Keepax <[email protected]>--- sound/soc/codecs/wm_adsp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)sound/soc/codecs/wm_adsp.c +0
-0@@ -2580,8 +2580,11 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,mutex_lock (&dsp->pwr_lock);
Quoted 9 lines
sound/soc/codecs/wm_adsp.c int wm_adsp2_event(struct snd_soc_dapm_widget *w, · line 2587
Quoted 6 lines
sound/soc/codecs/wm_adsp.c +4
-1-if (wm_adsp_fw[dsp->fw].num_caps !=0 ) +if (wm_adsp_fw[dsp->fw].num_caps !=0 ) { ret =wm_adsp_buffer_init (dsp); +if (ret <0 ) + goto err; + }Need to call
mutex_unlock()before jumping to err label?
Thanks, will respin.
Thanks,
Charles