Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: r80115 <alan.tull@freescale.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Subject: Re: [PATCH] ASoC don't clobber platform DMA driver ops
Date: Thu, 10 Nov 2011 09:14:25 -0600	[thread overview]
Message-ID: <4EBBEA51.90707@freescale.com> (raw)
In-Reply-To: <20111110114310.GA3832@opensource.wolfsonmicro.com>

On 11/10/2011 5:43 AM, Mark Brown wrote:
> On Tue, Nov 01, 2011 at 04:05:16PM -0500, Alan Tull wrote:
>
> This looks mostly good, though as someone pointed out earlier it'd be
> nicer to split the ioctl() operation addition out into a separate patch.
> One issue, though.
>
>> @@ -1547,6 +1547,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
>>
>>   	snd_soc_dapm_free(&card->dapm);
>>
>> +	kfree(card->rtd->ops);
>
> This is going to leak - rtd is an array per PCM, not a single value, so
> we need to free the ops for each element.  This is so we can have
> multiple DMA controllers in a single card.
>
> Actually what would be even easier would be to just embed the ops in the
> struct, we need to allocate one per runtime anyway and it makes for less
> allocation and cleanup code.
>

In soc-pcm.c we allocate:
soc_pcm_ops = kzalloc(sizeof(struct snd_pcm_ops), GFP_KERNEL);

and set it to the pointer

rtd->ops = soc_pcm_ops;

So that's what is freed there.

-- 
Regards,
Alan

  reply	other threads:[~2011-11-10 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 21:05 [PATCH] ASoC don't clobber platform DMA driver ops Alan Tull
2011-11-02  3:40 ` Tabi Timur-B04825
2011-11-02 10:24   ` Mark Brown
2011-11-10 11:43 ` Mark Brown
2011-11-10 15:14   ` r80115 [this message]
2011-11-10 15:16     ` Mark Brown
2011-11-10 15:20       ` r80115
2011-11-10 15:25         ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2011-11-15 15:59 Alan Tull
2011-11-15 16:56 ` Tabi Timur-B04825
2011-11-15 17:22   ` r80115
2011-11-01 18:45 Alan Tull
     [not found] ` <9E5C29D1DC97674D8FB0F7D26508F7861F05DB@039-SN1MPN1-005.039d.mgd.msft.net>
2011-11-01 18:49   ` Mark Brown
     [not found]     ` <9E5C29D1DC97674D8FB0F7D26508F7861F0620@039-SN1MPN1-005.039d.mgd.msft.net>
2011-11-01 19:11       ` Mark Brown

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=4EBBEA51.90707@freescale.com \
    --to=alan.tull@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    /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