Skip to contentSkip to conversation

ASoC: wm_adsp: Check return value from wm_adsp_buffer_init

PATCH In review Charles Keepax 3 participants 3 messages Nov 22, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---

Changes since v1:
- Add unlock of the mutex on the error path

Thanks,
Charles

 sound/soc/codecs/wm_adsp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +6 -1
index 6ccb731..e00ccfc 100644
@@ -2580,8 +2580,13 @@ 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) {
+				mutex_unlock(&dsp->pwr_lock);
+				goto err;
+			}
+		}
 
 		mutex_unlock(&dsp->pwr_lock);
 
Signature · 1 line
2.1.4
maintainer
#1 lore raw

Applied "ASoC: wm_adsp: Check return value from wm_adsp_buffer_init" to the asoc tree

The patch

ASoC: wm_adsp: Check return value from wm_adsp_buffer_init

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 48c2c99359044763b0cf21e59405638f9630fe06 Mon Sep 17 00:00:00 2001

From: Charles Keepax <[email protected]>
Date: Tue, 22 Nov 2016 15:38:34 +0000
Subject: [PATCH] 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 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +6 -1
index 6e6b9d838332..ff111a82fa3f 100644
@@ -2575,8 +2575,13 @@ 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) {
+				mutex_unlock(&dsp->pwr_lock);
+				goto err;
+			}
+		}
 
 		mutex_unlock(&dsp->pwr_lock);
 
Signature · 1 line
2.10.2
Reviewed-by on v2 1/1
#2 lore raw
In reply to Charles Keepax
Quoted 25 lines · Charles Keepax

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.

---

Changes since v1:
- Add unlock of the mutex on the error path

Thanks,
Charles

 sound/soc/codecs/wm_adsp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +0 -0
index 6ccb731..e00ccfc 100644
@@ -2580,8 +2580,13 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
 
 		mutex_lock(&dsp->pwr_lock);
 

sound/soc/codecs/wm_adsp.c int wm_adsp2_event(struct snd_soc_dapm_widget *w, · line 2591

Quoted 10 lines
sound/soc/codecs/wm_adsp.c +6 -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) {
+				mutex_unlock(&dsp->pwr_lock);
+				goto err;
+			}
+		}
 
 		mutex_unlock(&dsp->pwr_lock);

Regards

Takashi Sakamoto @ UTC+2