summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-generic-dmaengine-pcm.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2018-02-26 19:55:25 +0100
committerMark Brown <broonie@kernel.org>2018-02-26 20:59:31 +0100
commitb84acf44d5b86597cebcb6aca16e7dd9ca2b0294 (patch)
tree29cf101933d34eaa8418f98e150e927805cc42d2 /sound/soc/soc-generic-dmaengine-pcm.c
parentASoC: dmaengine_pcm: add processing support (diff)
downloadlinux-b84acf44d5b86597cebcb6aca16e7dd9ca2b0294.tar.xz
linux-b84acf44d5b86597cebcb6aca16e7dd9ca2b0294.zip
ASoC: Revert "ASoC: soc-generic-dmaengine-pcm: Fix error handling"
This reverts commit f91b1e73ccde71d4bc69ae10d475196df38844ab. As explained by Lars-Peter Clausen: "This creates a resource leak. dmaengine_pcm_request_chan_of() requests bothtransmit and receive channels. It might return with an error if one of them fails, but the other one succeeded. In this case we need to call dmaengine_pcm_release_chan() to free the requested channel" So revert the commit. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-generic-dmaengine-pcm.c')
-rw-r--r--sound/soc/soc-generic-dmaengine-pcm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 567fbdfd1ca9..56a541b9ff9e 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -504,7 +504,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
ret = dmaengine_pcm_request_chan_of(pcm, dev, config);
if (ret)
- goto err_free_pcm;
+ goto err_free_dma;
if (config && config->process)
ret = snd_soc_add_component(dev, &pcm->component,
@@ -520,7 +520,6 @@ int snd_dmaengine_pcm_register(struct device *dev,
err_free_dma:
dmaengine_pcm_release_chan(pcm);
-err_free_pcm:
kfree(pcm);
return ret;
}