summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd
diff options
context:
space:
mode:
authorColin Ian King2018-11-14 22:31:48 +0100
committerMark Brown2018-11-14 23:01:02 +0100
commit46dce4042659755a2b9753369d0c2d8ca33e35cf (patch)
tree3498d7c966eafe79b75366d1f7bd8936c39671f0 /sound/soc/amd
parentASoC: pcm3060: Add DT property for single-ended output (diff)
downloadkernel-qcow2-linux-46dce4042659755a2b9753369d0c2d8ca33e35cf.tar.gz
kernel-qcow2-linux-46dce4042659755a2b9753369d0c2d8ca33e35cf.tar.xz
kernel-qcow2-linux-46dce4042659755a2b9753369d0c2d8ca33e35cf.zip
ASoC: amd: fix memory leak of i2s_data on error return
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> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd')
-rw-r--r--sound/soc/amd/raven/acp3x-pcm-dma.c1
1 files changed, 1 insertions, 0 deletions
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;
}