linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
@ 2020-07-17  8:22 Jing Xiangfeng
  2020-07-17  8:44 ` Jerome Brunet
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jing Xiangfeng @ 2020-07-17  8:22 UTC (permalink / raw)
  To: jbrunet, lgirdwood, broonie, perex, tiwai, khilman, kuninori.morimoto.gx
  Cc: linux-amlogic, alsa-devel, linux-kernel, linux-arm-kernel, jingxiangfeng

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@huawei.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;
 
-- 
2.17.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
  2020-07-17  8:22 [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback Jing Xiangfeng
@ 2020-07-17  8:44 ` Jerome Brunet
  2020-07-17 15:39 ` Mark Brown
  2020-08-17 17:48 ` patchwork-bot+linux-amlogic
  2 siblings, 0 replies; 4+ messages in thread
From: Jerome Brunet @ 2020-07-17  8:44 UTC (permalink / raw)
  To: Jing Xiangfeng, lgirdwood, broonie, perex, tiwai, khilman,
	kuninori.morimoto.gx
  Cc: linux-amlogic, alsa-devel, linux-kernel, linux-arm-kernel


On Fri 17 Jul 2020 at 10:22, Jing Xiangfeng <jingxiangfeng@huawei.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@huawei.com>

Reviewed-by: Jerome Brunet <jbrunet@baylibre.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;


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
  2020-07-17  8:22 [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback Jing Xiangfeng
  2020-07-17  8:44 ` Jerome Brunet
@ 2020-07-17 15:39 ` Mark Brown
  2020-08-17 17:48 ` patchwork-bot+linux-amlogic
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-07-17 15:39 UTC (permalink / raw)
  To: tiwai, kuninori.morimoto.gx, lgirdwood, Jing Xiangfeng, perex,
	khilman, jbrunet
  Cc: linux-amlogic, alsa-devel, linux-kernel, linux-arm-kernel

On Fri, 17 Jul 2020 16:22:42 +0800, Jing Xiangfeng 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.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
      commit: bd054ece7d9cdd88e900df6625e951a01d9f655e

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

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
  2020-07-17  8:22 [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback Jing Xiangfeng
  2020-07-17  8:44 ` Jerome Brunet
  2020-07-17 15:39 ` Mark Brown
@ 2020-08-17 17:48 ` patchwork-bot+linux-amlogic
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-amlogic @ 2020-08-17 17:48 UTC (permalink / raw)
  To: Jing Xiangfeng; +Cc: linux-amlogic, khilman

Hello:

This patch was applied to khilman/linux-amlogic.git (refs/heads/for-next).

On Fri, 17 Jul 2020 16:22:42 +0800 you 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@huawei.com>
> 
> [...]


Here is a summary with links:
  - [v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
    https://git.kernel.org/khilman/linux-amlogic/c/bd054ece7d9cdd88e900df6625e951a01d9f655e

You are awesome, thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-17 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  8:22 [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback Jing Xiangfeng
2020-07-17  8:44 ` Jerome Brunet
2020-07-17 15:39 ` Mark Brown
2020-08-17 17:48 ` patchwork-bot+linux-amlogic

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).