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:20:35 -0600 [thread overview]
Message-ID: <4EBBEBC3.8060406@freescale.com> (raw)
In-Reply-To: <20111110151619.GI3832@opensource.wolfsonmicro.com>
On 11/10/2011 9:16 AM, Mark Brown wrote:
> On Thu, Nov 10, 2011 at 09:14:25AM -0600, r80115 wrote:
>> On 11/10/2011 5:43 AM, Mark Brown wrote:
>
>>> 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.
>
> You're not getting the point here. The point is that you're only
> freeing a single copy of the ops no matter how many are allocated.
>
I see. This is sounding like a significant rewrite. I'll have to
revisit this then. Thanks for catching that.
--
Regards,
Alan
next prev parent reply other threads:[~2011-11-10 15:21 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
2011-11-10 15:16 ` Mark Brown
2011-11-10 15:20 ` r80115 [this message]
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=4EBBEBC3.8060406@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