[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1j7dv2sf7w.fsf@starbuckisacylon.baylibre.com>
Date: Fri, 17 Jul 2020 10:44:35 +0200
From: Jerome Brunet <jbrunet@...libre.com>
To: Jing Xiangfeng <jingxiangfeng@...wei.com>, lgirdwood@...il.com,
broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
khilman@...libre.com, kuninori.morimoto.gx@...esas.com
Cc: alsa-devel@...a-project.org, linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
On Fri 17 Jul 2020 at 10:22, Jing Xiangfeng <jingxiangfeng@...wei.com> wrote:
> axg_card_add_tdm_loopback() misses to call kfree() in an error path. We
> can use devm_kasprintf() to fix the issue, also improve maintainability.
> So use it instead.
>
> Fixes: c84836d7f650 ("ASoC: meson: axg-card: use modern dai_link style")
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@...wei.com>
Reviewed-by: Jerome Brunet <jbrunet@...libre.com>
> ---
> sound/soc/meson/axg-card.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
> index 89f7f64747cd..47f2d93224fe 100644
> --- a/sound/soc/meson/axg-card.c
> +++ b/sound/soc/meson/axg-card.c
> @@ -116,7 +116,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card,
>
> lb = &card->dai_link[*index + 1];
>
> - lb->name = kasprintf(GFP_KERNEL, "%s-lb", pad->name);
> + lb->name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-lb", pad->name);
> if (!lb->name)
> return -ENOMEM;
Powered by blists - more mailing lists