From: Julia Lawall <julia@diku.dk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lrg@slimlogic.co.uk>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 8/8] sound/soc: introduce missing kfree
Date: Sat, 12 Sep 2009 13:58:58 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0909121357350.8557@pc-004.diku.dk> (raw)
In-Reply-To: <20090912115029.GA14300@sirena.org.uk>
On Sat, 12 Sep 2009, Mark Brown wrote:
> On Fri, Sep 11, 2009 at 06:23:04PM +0200, Julia Lawall wrote:
> > From: Julia Lawall <julia@diku.dk>
>
> > Error handling code following a kzalloc should free the allocated data.
> > Error handling code following an ioremap should iounmap the allocated data.
>
> This doesn't seem to be a complete fix for the issue. There are several
> other places where the function can fail but which don't do this cleanup
> - this may indicate a problem with the automatic analysis if it fails to
> spot the problem in the fixed code?
>
> In general for this sort of issue I'd suggest considering adding the
> error handling using the goto unwind block style since that tends to be
> a bit more robust against forgotten error handling than adding unwind
> code at each error site. It's also a bit more managable when the code
> is doing a series of allocations like this is.
OK, thanks for the suggestions. I see that there is a return near the
end:
if (rc) {
free_irq(psc_dma->irq, psc_dma);
free_irq(psc_dma->capture.irq,
&psc_dma->capture);
free_irq(psc_dma->playback.irq,
&psc_dma->playback);
return -ENODEV;
}
that I missed. I will send a new patch, using the suggested goto style.
julia
prev parent reply other threads:[~2009-09-12 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 16:23 Julia Lawall
2009-09-12 11:50 ` Mark Brown
2009-09-12 11:58 ` Julia Lawall [this message]
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=Pine.LNX.4.64.0909121357350.8557@pc-004.diku.dk \
--to=julia@diku.dk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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
all inboxes | Powered by JetHome®