* [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init
@ 2016-11-22 15:38 Charles Keepax
2016-11-22 19:13 ` Applied "ASoC: wm_adsp: Check return value from wm_adsp_buffer_init" to the asoc tree Mark Brown
2016-11-22 20:17 ` [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init Takashi Sakamoto
0 siblings, 2 replies; 3+ messages in thread
From: Charles Keepax @ 2016-11-22 15:38 UTC (permalink / raw)
To: broonie; +Cc: alsa-devel, patches, lgirdwood
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.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
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(-)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 6ccb731..e00ccfc 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -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);
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Applied "ASoC: wm_adsp: Check return value from wm_adsp_buffer_init" to the asoc tree
2016-11-22 15:38 [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init Charles Keepax
@ 2016-11-22 19:13 ` Mark Brown
2016-11-22 20:17 ` [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init Takashi Sakamoto
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-11-22 19:13 UTC (permalink / raw)
To: Charles Keepax; +Cc: alsa-devel, broonie, patches, lgirdwood
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
>From 48c2c99359044763b0cf21e59405638f9630fe06 Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
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.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/wm_adsp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 6e6b9d838332..ff111a82fa3f 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -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);
--
2.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init
2016-11-22 15:38 [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init Charles Keepax
2016-11-22 19:13 ` Applied "ASoC: wm_adsp: Check return value from wm_adsp_buffer_init" to the asoc tree Mark Brown
@ 2016-11-22 20:17 ` Takashi Sakamoto
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Sakamoto @ 2016-11-22 20:17 UTC (permalink / raw)
To: Charles Keepax, broonie; +Cc: alsa-devel, patches, lgirdwood
On Nov 22 2016 17:38, Charles Keepax wrote:
> 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.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
>
> 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(-)
>
> diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
> index 6ccb731..e00ccfc 100644
> --- a/sound/soc/codecs/wm_adsp.c
> +++ b/sound/soc/codecs/wm_adsp.c
> @@ -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);
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Regards
Takashi Sakamoto @ UTC+2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-22 20:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 15:38 [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init Charles Keepax
2016-11-22 19:13 ` Applied "ASoC: wm_adsp: Check return value from wm_adsp_buffer_init" to the asoc tree Mark Brown
2016-11-22 20:17 ` [PATCH v2] ASoC: wm_adsp: Check return value from wm_adsp_buffer_init Takashi Sakamoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox