From: Lars-Peter Clausen <lars@metafoo.de>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
lgirdwood@gmail.com
Subject: Re: [PATCH v2 3/5] ASoC: dapm: Append "Autodisable" to autodisable widget names
Date: Thu, 30 Apr 2015 19:40:42 +0200 [thread overview]
Message-ID: <5542691A.9050204@metafoo.de> (raw)
In-Reply-To: <1430411912-6599-3-git-send-email-ckeepax@opensource.wolfsonmicro.com>
On 04/30/2015 06:38 PM, Charles Keepax wrote:
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index beb48b6..e557018 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -308,11 +308,19 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
> {
> struct dapm_kcontrol_data *data;
> struct soc_mixer_control *mc;
> + const char *name;
> + int ret;
>
> data = kzalloc(sizeof(*data), GFP_KERNEL);
> if (!data)
> return -ENOMEM;
>
> + name = kasprintf(GFP_KERNEL, "%s %s", kcontrol->id.name, "Autodisable");
We should only allocate the name if we create a widget, otherwise we are
going to leak the memory.
> + if (!name) {
> + ret = -ENOMEM;
> + goto err_data;
> + }
> +
> INIT_LIST_HEAD(&data->paths);
>
next prev parent reply other threads:[~2015-04-30 17:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 16:38 [PATCH v2 1/5] ASoC: Correct typo in SOC_VALUE_ENUM_SINGLE macro Charles Keepax
2015-04-30 16:38 ` [PATCH v2 2/5] ASoC: dapm: Remove local OOM error message Charles Keepax
2015-04-30 16:38 ` [PATCH v2 3/5] ASoC: dapm: Append "Autodisable" to autodisable widget names Charles Keepax
2015-04-30 17:40 ` Lars-Peter Clausen [this message]
2015-04-30 16:38 ` [PATCH v2 4/5] ASoC: dapm: Add support for autodisable mux controls Charles Keepax
2015-04-30 17:48 ` Lars-Peter Clausen
2015-05-01 10:24 ` Charles Keepax
2015-04-30 16:38 ` [PATCH v2 5/5] ASoC: arizona: Use auto disable muxes for routing Charles Keepax
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=5542691A.9050204@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.wolfsonmicro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.