* [PATCH 1/2] ASoC: topology: free stream_name of dai_drv
@ 2019-03-05 15:57 Bard liao
2019-03-05 15:57 ` [PATCH 2/2] ASoC: topology: free link string in error Bard liao
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Bard liao @ 2019-03-05 15:57 UTC (permalink / raw)
To: broonie; +Cc: tiwai, liam.r.girdwood, alsa-devel, pierre-louis.bossart,
bard.liao
The stream_name is allocated by kstrdup. We have to free it when the
dai is removed or return from error.
Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
---
sound/soc/soc-topology.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 25fca7055464..4e05ef001e04 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -535,6 +535,8 @@ static void remove_dai(struct snd_soc_component *comp,
if (dai->driver == dai_drv)
dai->driver = NULL;
+ kfree(dai_drv->playback.stream_name);
+ kfree(dai_drv->capture.stream_name);
kfree(dai_drv->name);
list_del(&dobj->list);
kfree(dai_drv);
@@ -1806,6 +1808,9 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
ret = soc_tplg_dai_load(tplg, dai_drv, pcm, NULL);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: DAI loading failed\n");
+ kfree(dai_drv->playback.stream_name);
+ kfree(dai_drv->capture.stream_name);
+ kfree(dai_drv->name);
kfree(dai_drv);
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ASoC: topology: free link string in error
2019-03-05 15:57 [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Bard liao
@ 2019-03-05 15:57 ` Bard liao
2019-03-19 13:13 ` Applied "ASoC: topology: free link string in error" to the asoc tree Mark Brown
2019-03-06 17:56 ` [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Pierre-Louis Bossart
2019-03-19 13:13 ` Applied "ASoC: topology: free stream_name of dai_drv" to the asoc tree Mark Brown
2 siblings, 1 reply; 5+ messages in thread
From: Bard liao @ 2019-03-05 15:57 UTC (permalink / raw)
To: broonie; +Cc: tiwai, liam.r.girdwood, alsa-devel, pierre-louis.bossart,
bard.liao
Some strings are allocated by kstrdup, but not freed when error
happened.
Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
---
sound/soc/soc-topology.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 4e05ef001e04..bb055c001b9c 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1881,6 +1881,9 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
ret = soc_tplg_dai_link_load(tplg, link, NULL);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: FE link loading failed\n");
+ kfree(link->name);
+ kfree(link->stream_name);
+ kfree(link->cpu_dai_name);
kfree(link);
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ASoC: topology: free stream_name of dai_drv
2019-03-05 15:57 [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Bard liao
2019-03-05 15:57 ` [PATCH 2/2] ASoC: topology: free link string in error Bard liao
@ 2019-03-06 17:56 ` Pierre-Louis Bossart
2019-03-19 13:13 ` Applied "ASoC: topology: free stream_name of dai_drv" to the asoc tree Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2019-03-06 17:56 UTC (permalink / raw)
To: Bard liao, broonie; +Cc: tiwai, liam.r.girdwood, alsa-devel, bard.liao
On 3/5/19 9:57 AM, Bard liao wrote:
> The stream_name is allocated by kstrdup. We have to free it when the
> dai is removed or return from error.
>
> Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
I reviewed and verified the flows, so both patch1 and 2:
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thanks!
> ---
> sound/soc/soc-topology.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index 25fca7055464..4e05ef001e04 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -535,6 +535,8 @@ static void remove_dai(struct snd_soc_component *comp,
> if (dai->driver == dai_drv)
> dai->driver = NULL;
>
> + kfree(dai_drv->playback.stream_name);
> + kfree(dai_drv->capture.stream_name);
> kfree(dai_drv->name);
> list_del(&dobj->list);
> kfree(dai_drv);
> @@ -1806,6 +1808,9 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
> ret = soc_tplg_dai_load(tplg, dai_drv, pcm, NULL);
> if (ret < 0) {
> dev_err(tplg->comp->dev, "ASoC: DAI loading failed\n");
> + kfree(dai_drv->playback.stream_name);
> + kfree(dai_drv->capture.stream_name);
> + kfree(dai_drv->name);
> kfree(dai_drv);
> return ret;
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Applied "ASoC: topology: free link string in error" to the asoc tree
2019-03-05 15:57 ` [PATCH 2/2] ASoC: topology: free link string in error Bard liao
@ 2019-03-19 13:13 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-03-19 13:13 UTC (permalink / raw)
To: Bard liao
Cc: alsa-devel, tiwai, pierre-louis.bossart, liam.r.girdwood, broonie,
bard.liao
The patch
ASoC: topology: free link string in error
has been applied to the asoc tree at
https://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 b3718b8f7e9b4afdfd281d35233b078585aef2e9 Mon Sep 17 00:00:00 2001
From: Bard liao <yung-chuan.liao@linux.intel.com>
Date: Tue, 5 Mar 2019 23:57:53 +0800
Subject: [PATCH] ASoC: topology: free link string in error
Some strings are allocated by kstrdup, but not freed when error
happened.
Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/soc-topology.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 1be60cea2bf5..c6a30d000f59 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1883,6 +1883,9 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
ret = soc_tplg_dai_link_load(tplg, link, NULL);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: FE link loading failed\n");
+ kfree(link->name);
+ kfree(link->stream_name);
+ kfree(link->cpu_dai_name);
kfree(link);
return ret;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Applied "ASoC: topology: free stream_name of dai_drv" to the asoc tree
2019-03-05 15:57 [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Bard liao
2019-03-05 15:57 ` [PATCH 2/2] ASoC: topology: free link string in error Bard liao
2019-03-06 17:56 ` [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Pierre-Louis Bossart
@ 2019-03-19 13:13 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-03-19 13:13 UTC (permalink / raw)
To: Bard liao
Cc: alsa-devel, tiwai, pierre-louis.bossart, liam.r.girdwood, broonie,
bard.liao
The patch
ASoC: topology: free stream_name of dai_drv
has been applied to the asoc tree at
https://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 7b6f68a4df4df3a58e854d24da991640bd4d9590 Mon Sep 17 00:00:00 2001
From: Bard liao <yung-chuan.liao@linux.intel.com>
Date: Tue, 5 Mar 2019 23:57:52 +0800
Subject: [PATCH] ASoC: topology: free stream_name of dai_drv
The stream_name is allocated by kstrdup. We have to free it when the
dai is removed or return from error.
Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/soc-topology.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index fbee4720b834..1be60cea2bf5 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -535,6 +535,8 @@ static void remove_dai(struct snd_soc_component *comp,
if (dai->driver == dai_drv)
dai->driver = NULL;
+ kfree(dai_drv->playback.stream_name);
+ kfree(dai_drv->capture.stream_name);
kfree(dai_drv->name);
list_del(&dobj->list);
kfree(dai_drv);
@@ -1808,6 +1810,9 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
ret = soc_tplg_dai_load(tplg, dai_drv, pcm, NULL);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: DAI loading failed\n");
+ kfree(dai_drv->playback.stream_name);
+ kfree(dai_drv->capture.stream_name);
+ kfree(dai_drv->name);
kfree(dai_drv);
return ret;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-19 13:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-05 15:57 [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Bard liao
2019-03-05 15:57 ` [PATCH 2/2] ASoC: topology: free link string in error Bard liao
2019-03-19 13:13 ` Applied "ASoC: topology: free link string in error" to the asoc tree Mark Brown
2019-03-06 17:56 ` [PATCH 1/2] ASoC: topology: free stream_name of dai_drv Pierre-Louis Bossart
2019-03-19 13:13 ` Applied "ASoC: topology: free stream_name of dai_drv" 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).