mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
ASoC: Revert "ASoC: soc-generic-dmaengine-pcm: Fix error handling"
This reverts commit f91b1e73cc
.
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>
This commit is contained in:
parent
78648092ef
commit
b84acf44d5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user