alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Bard liao <yung-chuan.liao@linux.intel.com>, broonie@kernel.org
Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com,
	alsa-devel@alsa-project.org, bard.liao@intel.com
Subject: Re: [PATCH 1/2] ASoC: topology: free stream_name of dai_drv
Date: Wed, 6 Mar 2019 11:56:02 -0600	[thread overview]
Message-ID: <f7d43d6c-6c12-94a7-571f-ecf60f34cbca@linux.intel.com> (raw)
In-Reply-To: <20190305155753.10362-1-yung-chuan.liao@linux.intel.com>


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;
>   	}

  parent reply	other threads:[~2019-03-06 17:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Pierre-Louis Bossart [this message]
2019-03-19 13:13 ` Applied "ASoC: topology: free stream_name of dai_drv" " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7d43d6c-6c12-94a7-571f-ecf60f34cbca@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).