Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: ASoC: atmel-pcm-dma: Leaking memory in atmel_pcm_hw_params
Date: Mon, 18 Mar 2013 11:59:29 +0800	[thread overview]
Message-ID: <51469121.3070902@atmel.com> (raw)
In-Reply-To: <5145D5BE.3090501@metafoo.de>

Hi Lars,

On 3/17/2013 22:39, Lars-Peter Clausen wrote:
> Hi,
>
> The dmaengine based pcm driver for atmel calls snd_dmaengine_pcm_open from
> it's hw_params callback. There is nothing preventing an application calling
> hw_params more than once. snd_dmaengine_pcm_open allocates a new prtd struct
> each time it gets called. So in case hw_params is called multiple times we
> leak memory here.

I use alsa utils and don't meet this issue. Please point out which 
software you use meet this issue.

> Is there any specific reason why snd_dmaengine_pcm_open() needs to be called
> from the hw_params callback and why it can't be called from the open
> callback?

This is because dma data setting and usage.

The filter function depends on the data returned by
> snd_soc_dai_get_dma_data(), but as far as I can see the DAI driver calls
> snd_soc_dai_set_dma_data() from its startup() callback, so the data is
> available in the PCM drivers open callback.

Have you test this yet?

>
> - Lars
>

Best Regards,
Bo Shen

  reply	other threads:[~2013-03-18  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17 14:39 ASoC: atmel-pcm-dma: Leaking memory in atmel_pcm_hw_params Lars-Peter Clausen
2013-03-18  3:59 ` Bo Shen [this message]
2013-03-18 15:36   ` Lars-Peter Clausen
2013-03-19  1:18     ` Bo Shen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51469121.3070902@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lars@metafoo.de \
    --cc=nicolas.ferre@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox