All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.
@ 2012-04-19  0:37 Oleg Matcovschi
  2012-04-19 16:00 ` Ujfalusi, Peter
  0 siblings, 1 reply; 5+ messages in thread
From: Oleg Matcovschi @ 2012-04-19  0:37 UTC (permalink / raw)
  To: linux-omap, alsa-devel; +Cc: Jarkko Nikula, Oleg Matcovschi

Signed-off-by: Oleg Matcovschi <oleg.matcovschi@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);
+
 	return ret;
 }
 
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.
  2012-04-19  0:37 [PATCH] ASoC: omap-pcm: Free dma buffers in case of error Oleg Matcovschi
@ 2012-04-19 16:00 ` Ujfalusi, Peter
  2012-04-20 13:08   ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Ujfalusi, Peter @ 2012-04-19 16:00 UTC (permalink / raw)
  To: Oleg Matcovschi; +Cc: alsa-devel, linux-omap

Hi,

On Thu, Apr 19, 2012 at 3:37 AM, Oleg Matcovschi <oleg.matcovschi@ti.com> wrote:
> Signed-off-by: Oleg Matcovschi <oleg.matcovschi@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@ti.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.
  2012-04-19 16:00 ` Ujfalusi, Peter
@ 2012-04-20 13:08   ` Mark Brown
  2012-04-20 17:59     ` [alsa-devel] " Matcovschi, Oleg
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-04-20 13:08 UTC (permalink / raw)
  To: Ujfalusi, Peter; +Cc: alsa-devel, linux-omap, Oleg Matcovschi

On Thu, Apr 19, 2012 at 07:00:55PM +0300, Ujfalusi, Peter wrote:

> 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@ti.com>

Always CC maintainers on patches...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [alsa-devel] [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.
  2012-04-20 13:08   ` Mark Brown
@ 2012-04-20 17:59     ` Matcovschi, Oleg
  2012-04-23 12:04       ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Matcovschi, Oleg @ 2012-04-20 17:59 UTC (permalink / raw)
  To: Mark Brown, Ujfalusi, Peter; +Cc: alsa-devel, linux-omap

>From: Mark Brown [broonie@opensource.wolfsonmicro.com]
>Sent: Friday, April 20, 2012 6:08 AM
>To: Ujfalusi, Peter
>Cc: Matcovschi, Oleg; alsa-devel@alsa-project.org; linux-omap@vger.kernel.org
>Subject: Re: [alsa-devel] [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.

>On Thu, Apr 19, 2012 at 07:00:55PM +0300, Ujfalusi, Peter wrote:

>> 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@ti.com>

>Always CC maintainers on patches...

Should I resend patch again including maintainers?
Sorry, my first patch. Will do in future patches.

-Oleg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: omap-pcm: Free dma buffers in case of error.
  2012-04-20 17:59     ` [alsa-devel] " Matcovschi, Oleg
@ 2012-04-23 12:04       ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2012-04-23 12:04 UTC (permalink / raw)
  To: Matcovschi, Oleg; +Cc: Ujfalusi, Peter, alsa-devel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

On Fri, Apr 20, 2012 at 05:59:25PM +0000, Matcovschi, Oleg wrote:

> Should I resend patch again including maintainers?

Please, I didn't see it so I'll need a copy if I'm going to review it.

> Sorry, my first patch. Will do in future patches.

No worries.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-23 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  0:37 [PATCH] ASoC: omap-pcm: Free dma buffers in case of error Oleg Matcovschi
2012-04-19 16:00 ` Ujfalusi, Peter
2012-04-20 13:08   ` Mark Brown
2012-04-20 17:59     ` [alsa-devel] " Matcovschi, Oleg
2012-04-23 12:04       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.