* [PATCH] ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
@ 2016-08-16 10:24 Charles Keepax
2016-08-16 11:30 ` Applied "ASoC: compress: Fix leak of a widget list in soc_compr_open_fe" to the asoc tree Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2016-08-16 10:24 UTC (permalink / raw)
To: broonie; +Cc: vinod.koul, alsa-devel, patches, lgirdwood
After we have called dpcm_path_get we should make sure to call
dpcm_path_put on all error paths. This was not happening causing the
allocated widget list to be leaked, this patch corrects this by adding a
dpcm_path_put to the error path.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
sound/soc/soc-compress.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index d2df46c..bf7b52f 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
dpcm_be_disconnect(fe, stream);
fe->dpcm[stream].runtime = NULL;
- goto fe_err;
+ goto path_err;
}
dpcm_clear_pending_state(fe, stream);
@@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
return 0;
+path_err:
+ dpcm_path_put(&list);
fe_err:
if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown)
fe->dai_link->compr_ops->shutdown(cstream);
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Applied "ASoC: compress: Fix leak of a widget list in soc_compr_open_fe" to the asoc tree
2016-08-16 10:24 [PATCH] ASoC: compress: Fix leak of a widget list in soc_compr_open_fe Charles Keepax
@ 2016-08-16 11:30 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2016-08-16 11:30 UTC (permalink / raw)
To: Charles Keepax; +Cc: vinod.koul, alsa-devel, broonie, patches, lgirdwood
The patch
ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
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 b0f12c61de013ecb0abe19d5e64bdab45989de5a Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date: Tue, 16 Aug 2016 11:24:46 +0100
Subject: [PATCH] ASoC: compress: Fix leak of a widget list in
soc_compr_open_fe
After we have called dpcm_path_get we should make sure to call
dpcm_path_put on all error paths. This was not happening causing the
allocated widget list to be leaked, this patch corrects this by adding a
dpcm_path_put to the error path.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/soc-compress.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index d2df46c14c68..bf7b52fce597 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
dpcm_be_disconnect(fe, stream);
fe->dpcm[stream].runtime = NULL;
- goto fe_err;
+ goto path_err;
}
dpcm_clear_pending_state(fe, stream);
@@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
return 0;
+path_err:
+ dpcm_path_put(&list);
fe_err:
if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown)
fe->dai_link->compr_ops->shutdown(cstream);
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-16 11:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 10:24 [PATCH] ASoC: compress: Fix leak of a widget list in soc_compr_open_fe Charles Keepax
2016-08-16 11:30 ` Applied "ASoC: compress: Fix leak of a widget list in soc_compr_open_fe" to the asoc tree 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).