[alsa-devel] [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.
Ujfalusi, Peter
peter.ujfalusi at ti.com
Thu Apr 19 18:00:55 CEST 2012
Hi,
On Thu, Apr 19, 2012 at 3:37 AM, Oleg Matcovschi <oleg.matcovschi at ti.com> wrote:
> Signed-off-by: Oleg Matcovschi <oleg.matcovschi at ti.com>
> ---
> sound/soc/omap/omap-pcm.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
> index a2a464f..380a5bd 100644
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -414,6 +414,10 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
> }
>
> out:
> + /* free preallocated buffers in case of error */
> + if (ret)
> + omap_pcm_free_dma_buffers(pcm);
> +
If the playback preallocation fails, or if only capture is supported
on the dai link
this is not needed.
It only applies if we have both playback and capture streams and the capture
preallocation fails.
Luckily the omap_pcm_free_dma_buffers() has internal checks for these cases...
Acked-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
More information about the Alsa-devel
mailing list