[alsa-devel] [PATCH v2 1/3] ASoC: dapm: dapm_dai_get_connected_widgets: Fix missing mutex unlock

Lars-Peter Clausen lars at metafoo.de
Tue Aug 11 21:37:59 CEST 2015


Make sure to unlock the DAPM mutex when dapm_widget_list_create() fails.

This means the function will now generate a trace_snd_soc_dapm_connected
event, even if the creation of the list fails. But that was the behavior
before the patch that introduced the unlock issue, so that should be fine.

Fixes: 1ce43acff0c0 ("ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets()")
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
---
New in v2
---
 sound/soc/soc-dapm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7482c5d..c391bfe 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1191,7 +1191,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
 
 	ret = dapm_widget_list_create(list, &widgets);
 	if (ret)
-		return ret;
+		paths = ret;
 
 	trace_snd_soc_dapm_connected(paths, stream);
 	mutex_unlock(&card->dapm_mutex);
-- 
2.1.4



More information about the Alsa-devel mailing list