From: Stephen Rothwell <sfr@canb.auug.org.au>
To: michael@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org, Jesper Juhl <jj@chaosbits.net>,
Paul Mackerras <paulus@samba.org>,
linux-kernel@vger.kernel.org, Stephen Rothwell <sfr@pcug.org.au>
Subject: Re: [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
Date: Tue, 2 Nov 2010 07:10:25 +1100 [thread overview]
Message-ID: <20101102071025.2fe5e6ca.sfr@canb.auug.org.au> (raw)
In-Reply-To: <1288609842.10671.7.camel@concordia>
[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]
Hi Jesper,
On Mon, 01 Nov 2010 22:10:42 +1100 Michael Ellerman <michael@ellerman.id.au> wrote:
>
> On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> >
> > If memory is tight and a dynamic allocation fails there's no reason to
> > make a bad situation worse by leaking memory.
> >
> > mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing
> > to do is to free that memory again before returning -ENOMEM - which is
> > what this patch does.
> >
> > I realize that the function is under '#if 0' so this probably doesn't
> > matter much, but I assume that the function is still there for a reason
> > (but I could be wrong, I don't know the powerpc code).
> > Anyway, I suggest we remove the leak.
>
> Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
> I don't think it will ever be un-ifdef'ed, so should probably just be
> removed.
Well, only unofficially iseries maintainer :-)
Yes, just remove the whole function ... it was never used and never will
be.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2010-11-01 20:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-30 17:20 [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory Jesper Juhl
2010-11-01 11:10 ` Michael Ellerman
2010-11-01 20:10 ` Stephen Rothwell [this message]
2010-11-01 20:06 ` [PATCH] iSeries: Remove unused mf_getSrcHistory function Jesper Juhl
2010-11-01 21:26 ` Stephen Rothwell
2010-11-01 21:20 ` Jesper Juhl
2010-11-02 0:20 ` Michael Ellerman
2010-11-04 23:29 ` [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller Jesper Juhl
2010-11-18 19:45 ` Jesper Juhl
2010-11-18 21:57 ` Michael Ellerman
2010-11-18 21:51 ` Jesper Juhl
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=20101102071025.2fe5e6ca.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=paulus@samba.org \
--cc=sfr@pcug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).