Skip to content

Commit

Permalink
ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
Browse files Browse the repository at this point in the history
[ Upstream commit bd054ec ]

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: c84836d ("ASoC: meson: axg-card: use modern dai_link style")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200717082242.130627-1-jingxiangfeng@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
hiss2018 authored and gregkh committed Aug 19, 2020
1 parent 2698fab commit c537bd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/meson/axg-card.c
Expand Up @@ -266,7 +266,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;

Expand Down

0 comments on commit c537bd0

Please sign in to comment.