public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Roger Willcocks <roger@filmlight.ltd.uk>
Cc: Mark Tinguely <tinguely@sgi.com>, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fix memory leak in xfs_dir2_node_removename
Date: Fri, 27 Sep 2013 15:04:32 -0500	[thread overview]
Message-ID: <5245E4D0.6090108@sandeen.net> (raw)
In-Reply-To: <1380310573.22649.1082.camel@montana.filmlight.ltd.uk>

On 9/27/13 2:36 PM, Roger Willcocks wrote:
> 
> On Fri, 2013-09-27 at 08:01 -0500, Mark Tinguely wrote:
>> plain text document attachment
>> (xfs-fix-leak-in-xfs_dir2_node_removename.patch)
>> Free the memory pointed to by state before returning on error from 
>> xfs_dir2_node_removename.c
>>
>> Signed-off-by: Mark Tinguely <tinguely@sgi.com>
>> ---
>> Found by Coverity (134681) in userspace, same patch applies there
>> also.
>>
> 
> Is the first hunk right ?
> 
> xfs_da_node_lookup_int called as
> 
>         error = xfs_da_node_lookup_int(state, &rval);
> 
> and returns with
> 
>         *result = retval;
>         return(0);
> 
> so, on return, error == 0 and rval == an error code. The next lines:
> 
>         if (error)
>                 rval = error;
> 
> won't change that. But previously if rval != EEXIST you returned rval.
> With the change below, you return error, which is zero.

Oh geez.  o_O . . . Thanks Roger.

3rd review's the charm? ;)

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2013-09-27 20:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 13:01 [PATCH] xfs: fix memory leak in xfs_dir2_node_removename Mark Tinguely
2013-09-27 13:08 ` Carlos Maiolino
2013-09-27 16:44 ` Eric Sandeen
2013-09-27 17:48   ` Mark Tinguely
2013-09-27 17:55     ` Eric Sandeen
2013-09-27 19:36 ` Roger Willcocks
2013-09-27 19:52   ` Mark Tinguely
2013-09-27 20:04   ` Eric Sandeen [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=5245E4D0.6090108@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=roger@filmlight.ltd.uk \
    --cc=tinguely@sgi.com \
    --cc=xfs@oss.sgi.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