ASoC: omap-pcm: Free dma buffers in case of error.
authorOleg Matcovschi <oleg.matcovschi@ti.com>
Wed, 25 Apr 2012 02:02:02 +0000 (19:02 -0700)
committerLiam Girdwood <lrg@ti.com>
Fri, 4 May 2012 11:09:28 +0000 (12:09 +0100)
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
sound/soc/omap/omap-pcm.c

index a59bd35..5a649da 100644 (file)
@@ -401,6 +401,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);
+
        return ret;
 }