All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: meson: add the missed kfree() for axg_card_add_tdm_loopback
@ 2020-07-16 13:25 ` Jing Xiangfeng
  0 siblings, 0 replies; 16+ messages in thread
From: Jing Xiangfeng @ 2020-07-16 13:25 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. Add
the missed function call to fix it.

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 89f7f64747cd..6eac22ba8b99 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -121,8 +121,10 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card,
 		return -ENOMEM;
 
 	dlc = devm_kzalloc(card->dev, 2 * sizeof(*dlc), GFP_KERNEL);
-	if (!dlc)
+	if (!dlc) {
+		kfree(lb->name);
 		return -ENOMEM;
+	}
 
 	lb->cpus = &dlc[0];
 	lb->codecs = &dlc[1];
-- 
2.17.1


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

end of thread, other threads:[~2020-07-17  1:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-16 13:25 [PATCH] ASoC: meson: add the missed kfree() for axg_card_add_tdm_loopback Jing Xiangfeng
2020-07-16 13:25 ` Jing Xiangfeng
2020-07-16 13:25 ` Jing Xiangfeng
2020-07-16 13:25 ` Jing Xiangfeng
2020-07-16 13:29 ` Jerome Brunet
2020-07-16 13:29   ` Jerome Brunet
2020-07-16 13:29   ` Jerome Brunet
2020-07-16 13:29   ` Jerome Brunet
2020-07-16 14:34   ` Mark Brown
2020-07-16 14:34     ` Mark Brown
2020-07-16 14:34     ` Mark Brown
2020-07-16 14:34     ` Mark Brown
2020-07-17  1:49   ` Jing Xiangfeng
2020-07-17  1:49     ` Jing Xiangfeng
2020-07-17  1:49     ` Jing Xiangfeng
2020-07-17  1:49     ` Jing Xiangfeng

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.