All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linuxppc-dev@lists.ozlabs.org, 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: Mon, 01 Nov 2010 22:10:42 +1100	[thread overview]
Message-ID: <1288609842.10671.7.camel@concordia> (raw)
In-Reply-To: <alpine.LNX.2.00.1010301911220.1572@swampdragon.chaosbits.net>

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> Hi,
> 
> 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.

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <michael@ellerman.id.au>
To: Jesper Juhl <jj@chaosbits.net>
Cc: Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.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: Mon, 01 Nov 2010 22:10:42 +1100	[thread overview]
Message-ID: <1288609842.10671.7.camel@concordia> (raw)
In-Reply-To: <alpine.LNX.2.00.1010301911220.1572@swampdragon.chaosbits.net>

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> Hi,
> 
> 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.

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-11-01 11:10 UTC|newest]

Thread overview: 17+ 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-10-30 17:20 ` Jesper Juhl
2010-11-01 11:10 ` Michael Ellerman [this message]
2010-11-01 11:10   ` Michael Ellerman
2010-11-01 20:10   ` Stephen Rothwell
2010-11-01 20:10     ` Stephen Rothwell
2010-11-01 20:06     ` [PATCH] iSeries: Remove unused mf_getSrcHistory function Jesper Juhl
2010-11-01 20:06       ` Jesper Juhl
2010-11-01 21:26       ` Stephen Rothwell
2010-11-01 21:26         ` Stephen Rothwell
2010-11-01 21:20         ` Jesper Juhl
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=1288609842.10671.7.camel@concordia \
    --to=michael@ellerman.id.au \
    --cc=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.