From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Graham Gower <graham.gower@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: Fix passing platform_data to ac97 bus users and fix a leak.
Date: Wed, 24 Mar 2010 13:06:12 +0000 [thread overview]
Message-ID: <20100324130611.GA26910@sirena.org.uk> (raw)
In-Reply-To: <4BA99514.8020708@gmail.com>
On Wed, Mar 24, 2010 at 02:59:08PM +1030, Graham Gower wrote:
> snd_soc_new_ac97_codec() allocates for codec->ac97, snd_soc_new_pcms()
> then sets the platform_data. However, snd_ac97_mixer() overwrites
> codec->ac97 with its own allocated struct snd_ac97.
Please remember to CC maintainers on patches, this helps avoid patches
getting lost in mailing lists - the procedure in SubmittingPatches
should generally be followed.
> @@ -118,11 +120,21 @@ static int ac97_soc_probe(struct platform_device *pdev)
> if (ret < 0)
> goto bus_err;
>
> + /* free the ac97 here so that we don't leak it in snd_ac97_mixer */
> + snd_soc_free_ac97_codec(codec);
> +
Like Liam says this seems wrong - why would we have allocated this early
on in the probe() only to free it later?
Note also that this code needs to work with both ASoC-native AC97
drivers and the ac97.c bodge.
next prev parent reply other threads:[~2010-03-24 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 4:29 [PATCH] ASoC: Fix passing platform_data to ac97 bus users and fix a leak Graham Gower
2010-03-24 9:23 ` Liam Girdwood
2010-03-24 13:06 ` Mark Brown [this message]
2010-03-25 0:22 ` Graham Gower
2010-03-25 8:55 ` Liam Girdwood
2010-03-25 16:09 ` 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=20100324130611.GA26910@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=graham.gower@gmail.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