* [PATCH][next] ASoC: amd: fix memory leak of i2s_data on error return
@ 2018-11-14 21:31 Colin King
0 siblings, 0 replies; only message in thread
From: Colin King @ 2018-11-14 21:31 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Maruthi Bayyavarapu, Vijendar Mukunda, alsa-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently when snd_pcm_hw_constraint_integer fails there is
a memory leak of i2s_data on the error return path. Fix this by
kfree'ing i2s_data before returning.
Detected by CoverityScan, CID#1475479 ("Resource leak")
Fixes: 0b87d6bcd648 ("ASoC: amd: add acp3x pcm driver dma ops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
sound/soc/amd/raven/acp3x-pcm-dma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index 2e61cef00f41..b16cdd187139 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -309,6 +309,7 @@ static int acp3x_dma_open(struct snd_pcm_substream *substream)
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0) {
dev_err(component->dev, "set integer constraint failed\n");
+ kfree(i2s_data);
return ret;
}
--
2.19.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-14 21:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 21:31 [PATCH][next] ASoC: amd: fix memory leak of i2s_data on error return Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®