* [patch] ASoC: dapm: release lock on error paths
@ 2012-04-13 19:25 Dan Carpenter
2012-04-15 9:47 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-04-13 19:25 UTC (permalink / raw)
To: Liam Girdwood; +Cc: Takashi Iwai, alsa-devel, Mark Brown, kernel-janitors
We added locking here but there were a couple error paths where we
forgot to drop the lock before returning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 82e99b6..3191d01 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2133,7 +2133,7 @@ err:
int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num)
{
- int i, ret;
+ int i, ret = 0;
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
for (i = 0; i < num; i++) {
@@ -2141,13 +2141,13 @@ int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
if (ret < 0) {
dev_err(dapm->dev, "Failed to add route %s->%s\n",
route->source, route->sink);
- return ret;
+ break;
}
route++;
}
mutex_unlock(&dapm->card->dapm_mutex);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_add_routes);
@@ -2851,6 +2851,7 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
{
struct snd_soc_dapm_widget *w;
int i;
+ int ret = 0;
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
for (i = 0; i < num; i++) {
@@ -2859,12 +2860,13 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
dev_err(dapm->dev,
"ASoC: Failed to create DAPM control %s\n",
widget->name);
- return -ENOMEM;
+ ret = -ENOMEM;
+ break;
}
widget++;
}
mutex_unlock(&dapm->card->dapm_mutex);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_new_controls);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [patch] ASoC: dapm: release lock on error paths
2012-04-13 19:25 [patch] ASoC: dapm: release lock on error paths Dan Carpenter
@ 2012-04-15 9:47 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-04-15 9:47 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Takashi Iwai, alsa-devel, kernel-janitors, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 194 bytes --]
On Fri, Apr 13, 2012 at 10:25:43PM +0300, Dan Carpenter wrote:
> We added locking here but there were a couple error paths where we
> forgot to drop the lock before returning.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-15 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-13 19:25 [patch] ASoC: dapm: release lock on error paths Dan Carpenter
2012-04-15 9:47 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).